/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('appstream-center', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AccessPageSetAclRequest {
  accessMode?: string(name='AccessMode', description='This parameter is required.', example='FREE_ACCESS'),
  accessPageId?: string(name='AccessPageId', description='This parameter is required.', example='a-062wec3cwmayw****'),
  accessPageName?: string(name='AccessPageName', example='notepad_test'),
  effectTime?: int32(name='EffectTime', description='This parameter is required.', example='7'),
  unit?: string(name='Unit', example='Day'),
}

model AccessPageSetAclResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='InternalError'),
  requestId?: string(name='RequestId', example='E25FC620-6B6F-12D2-A992-AD8727DC****'),
  success?: string(name='Success', example='true'),
}

model AccessPageSetAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AccessPageSetAclResponseBody(name='body'),
}

/**
 * @summary 更新访问管理
 *
 * @param request AccessPageSetAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AccessPageSetAclResponse
 */
async function accessPageSetAclWithOptions(request: AccessPageSetAclRequest, runtime: Util.RuntimeOptions): AccessPageSetAclResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessMode)) {
    query['AccessMode'] = request.accessMode;
  }
  if (!Util.isUnset(request.accessPageId)) {
    query['AccessPageId'] = request.accessPageId;
  }
  if (!Util.isUnset(request.accessPageName)) {
    query['AccessPageName'] = request.accessPageName;
  }
  if (!Util.isUnset(request.effectTime)) {
    query['EffectTime'] = request.effectTime;
  }
  if (!Util.isUnset(request.unit)) {
    query['Unit'] = request.unit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AccessPageSetAcl',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新访问管理
 *
 * @param request AccessPageSetAclRequest
 * @return AccessPageSetAclResponse
 */
async function accessPageSetAcl(request: AccessPageSetAclRequest): AccessPageSetAclResponse {
  var runtime = new Util.RuntimeOptions{};
  return accessPageSetAclWithOptions(request, runtime);
}

model ApproveOtaTaskRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group. You can call the [ListAppInstanceGroup](https://help.aliyun.com/document_detail/428506.html) operation to obtain the ID.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region where the delivery group resides. You can call the [ListRegions](https://help.aliyun.com/document_detail/428500.html) operation to query the list of regions supported by App Streaming.

This parameter is required.', example='cn-hangzhou'),
  otaType?: string(name='OtaType', description='The type of the OTA update task.

Valid values:

*   Fota: update of the system components of Alibaba Cloud Workspace
*   AppUpdate
*   ImageUpdate

This parameter is required.', example='Fota'),
  startTime?: string(name='StartTime', description='The start time of the OTA update task. The time follows the ISO 8601 standard.

This parameter is required.

Use the UTC time format: yyyy-MM-ddTHH:mmZ', example='2022-08-04T14:36:00+08:00'),
  taskId?: string(name='TaskId', description='The ID of the OTA update task. You can call the [ListAppInstanceGroup](https://help.aliyun.com/document_detail/428506.html) operation to obtain the ID.

>  Each successful call to the `ApproveOtaTask` operation causes a value change of this parameter.`` Before you call this operation, call the `ListAppInstanceGroup` operation again to obtain the latest value of this parameter.``

This parameter is required.', example='ota-be7jzm29wrrz5****'),
}

model ApproveOtaTaskResponseBody = {
  code?: string(name='Code', description='The execution result. If the request was successful, `success` is returned. If the request failed, an error message is returned.', example='OtaTask.Running'),
  message?: string(name='Message', description='The error message. If the value of `Code` is `success`, this parameter is not returned.', example='The task is running and cannot be sumitted.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ApproveOtaTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApproveOtaTaskResponseBody(name='body'),
}

/**
 * @summary Sets the execution time of an over-the-air (OTA) update task.
 *
 * @param request ApproveOtaTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApproveOtaTaskResponse
 */
async function approveOtaTaskWithOptions(request: ApproveOtaTaskRequest, runtime: Util.RuntimeOptions): ApproveOtaTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    body['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.otaType)) {
    body['OtaType'] = request.otaType;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ApproveOtaTask',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sets the execution time of an over-the-air (OTA) update task.
 *
 * @param request ApproveOtaTaskRequest
 * @return ApproveOtaTaskResponse
 */
async function approveOtaTask(request: ApproveOtaTaskRequest): ApproveOtaTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return approveOtaTaskWithOptions(request, runtime);
}

model AskSessionPackagePriceRequest {
  chargeType?: string(name='ChargeType'),
  maxSessions?: int32(name='MaxSessions'),
  period?: int32(name='Period'),
  periodUnit?: string(name='PeriodUnit'),
  region?: string(name='Region', description='This parameter is required.', example='cn-hangzhou'),
  sessionPackageType?: string(name='SessionPackageType', example='0'),
  sessionSpec?: string(name='SessionSpec', description='This parameter is required.', example='appstreaming.general.entry'),
  sessionType?: string(name='SessionType', description='This parameter is required.', example='Windows'),
}

model AskSessionPackagePriceResponseBody = {
  data?: [ 
    {
      price?: {
        currency?: string(name='Currency', example='CNY'),
        discountPrice?: float(name='DiscountPrice', example='0.0'),
        originalPrice?: float(name='OriginalPrice', example='2000.0'),
        tradePrice?: float(name='TradePrice', example='2000.0'),
      }(name='Price'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='2C64D9E5-DFCD-10A5-A911-xxxxxxx'),
}

model AskSessionPackagePriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AskSessionPackagePriceResponseBody(name='body'),
}

/**
 * @summary 会话包收费查询
 *
 * @param request AskSessionPackagePriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AskSessionPackagePriceResponse
 */
async function askSessionPackagePriceWithOptions(request: AskSessionPackagePriceRequest, runtime: Util.RuntimeOptions): AskSessionPackagePriceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.maxSessions)) {
    query['MaxSessions'] = request.maxSessions;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.sessionPackageType)) {
    query['SessionPackageType'] = request.sessionPackageType;
  }
  if (!Util.isUnset(request.sessionSpec)) {
    query['SessionSpec'] = request.sessionSpec;
  }
  if (!Util.isUnset(request.sessionType)) {
    query['SessionType'] = request.sessionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AskSessionPackagePrice',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 会话包收费查询
 *
 * @param request AskSessionPackagePriceRequest
 * @return AskSessionPackagePriceResponse
 */
async function askSessionPackagePrice(request: AskSessionPackagePriceRequest): AskSessionPackagePriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return askSessionPackagePriceWithOptions(request, runtime);
}

model AuthorizeInstanceGroupRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='This parameter is required.', example='aig-9ciijz60n4xsv****'),
  appInstancePersistentId?: string(name='AppInstancePersistentId', description='持久会话ID。', example='p-0cc7s3mw2fg4j****'),
  authorizeUserIds?: [ string ](name='AuthorizeUserIds', description='The IDs of the users that you want to add to the authorization list of the delivery group. You can specify 1 to 100 user IDs.'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
  unAuthorizeUserIds?: [ string ](name='UnAuthorizeUserIds', description='The IDs of the users that you want to remove from the authorization list of the delivery group. You can specify 1 to 100 user IDs.'),
  userMeta?: {
    adDomain?: string(name='AdDomain', description='The AD domain name.', example='example.com'),
    type?: string(name='Type', description='The user type.

Valid values:

*   ad: Active Directory (AD) account
*   simple: convenience account', example='simple'),
  }(name='UserMeta', description='The user information.'),
}

model AuthorizeInstanceGroupShrinkRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='This parameter is required.', example='aig-9ciijz60n4xsv****'),
  appInstancePersistentId?: string(name='AppInstancePersistentId', description='持久会话ID。', example='p-0cc7s3mw2fg4j****'),
  authorizeUserIds?: [ string ](name='AuthorizeUserIds', description='The IDs of the users that you want to add to the authorization list of the delivery group. You can specify 1 to 100 user IDs.'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
  unAuthorizeUserIds?: [ string ](name='UnAuthorizeUserIds', description='The IDs of the users that you want to remove from the authorization list of the delivery group. You can specify 1 to 100 user IDs.'),
  userMetaShrink?: string(name='UserMeta', description='The user information.'),
}

model AuthorizeInstanceGroupResponseBody = {
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model AuthorizeInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AuthorizeInstanceGroupResponseBody(name='body'),
}

/**
 * @summary 授权用户
 *
 * @param tmpReq AuthorizeInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AuthorizeInstanceGroupResponse
 */
async function authorizeInstanceGroupWithOptions(tmpReq: AuthorizeInstanceGroupRequest, runtime: Util.RuntimeOptions): AuthorizeInstanceGroupResponse {
  Util.validateModel(tmpReq);
  var request = new AuthorizeInstanceGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.userMeta)) {
    request.userMetaShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userMeta, 'UserMeta', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstancePersistentId)) {
    body['AppInstancePersistentId'] = request.appInstancePersistentId;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.authorizeUserIds)) {
    bodyFlat['AuthorizeUserIds'] = request.authorizeUserIds;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.unAuthorizeUserIds)) {
    bodyFlat['UnAuthorizeUserIds'] = request.unAuthorizeUserIds;
  }
  if (!Util.isUnset(request.userMetaShrink)) {
    body['UserMeta'] = request.userMetaShrink;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AuthorizeInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 授权用户
 *
 * @param request AuthorizeInstanceGroupRequest
 * @return AuthorizeInstanceGroupResponse
 */
async function authorizeInstanceGroup(request: AuthorizeInstanceGroupRequest): AuthorizeInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return authorizeInstanceGroupWithOptions(request, runtime);
}

model BuySessionPackageRequest {
  autoPay?: boolean(name='AutoPay'),
  chargeType?: string(name='ChargeType'),
  maxSessions?: int32(name='MaxSessions'),
  period?: int32(name='Period'),
  periodUnit?: string(name='PeriodUnit'),
  projectId?: string(name='ProjectId', example='p-xxxxxxxxxxxxx'),
  region?: string(name='Region', description='This parameter is required.', example='cn-hangzhou'),
  sessionPackageName?: string(name='SessionPackageName'),
  sessionPackageType?: string(name='SessionPackageType', example='0'),
  sessionSpec?: string(name='SessionSpec', description='This parameter is required.', example='appstreaming.general.entry'),
  sessionType?: string(name='SessionType', description='This parameter is required.', example='Windows'),
}

model BuySessionPackageResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='There is a missing parameter.'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5Fxxxxxxxx'),
  sessionPackageId?: long(name='SessionPackageId', example='tp-xxxxxxxxxx'),
  success?: string(name='Success', example='false'),
}

model BuySessionPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BuySessionPackageResponseBody(name='body'),
}

/**
 * @summary 配置会话包
 *
 * @param request BuySessionPackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BuySessionPackageResponse
 */
async function buySessionPackageWithOptions(request: BuySessionPackageRequest, runtime: Util.RuntimeOptions): BuySessionPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.maxSessions)) {
    query['MaxSessions'] = request.maxSessions;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.sessionPackageName)) {
    query['SessionPackageName'] = request.sessionPackageName;
  }
  if (!Util.isUnset(request.sessionPackageType)) {
    query['SessionPackageType'] = request.sessionPackageType;
  }
  if (!Util.isUnset(request.sessionSpec)) {
    query['SessionSpec'] = request.sessionSpec;
  }
  if (!Util.isUnset(request.sessionType)) {
    query['SessionType'] = request.sessionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BuySessionPackage',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 配置会话包
 *
 * @param request BuySessionPackageRequest
 * @return BuySessionPackageResponse
 */
async function buySessionPackage(request: BuySessionPackageRequest): BuySessionPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return buySessionPackageWithOptions(request, runtime);
}

model CreateAccessPageRequest {
  accessPageName?: string(name='AccessPageName', description='This parameter is required.'),
  cloudEnvId?: string(name='CloudEnvId', example='c-e-06gdesdaxez****'),
  effectTime?: int32(name='EffectTime', example='7'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='p-065zdecaer07h****'),
  projectName?: string(name='ProjectName'),
  unit?: string(name='Unit', example='Day'),
}

model CreateAccessPageResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='a-06xnr5lyp77e7****'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  success?: string(name='Success', example='true'),
}

model CreateAccessPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccessPageResponseBody(name='body'),
}

/**
 * @summary 创建访问页面 
 *
 * @param request CreateAccessPageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccessPageResponse
 */
async function createAccessPageWithOptions(request: CreateAccessPageRequest, runtime: Util.RuntimeOptions): CreateAccessPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPageName)) {
    query['AccessPageName'] = request.accessPageName;
  }
  if (!Util.isUnset(request.cloudEnvId)) {
    query['CloudEnvId'] = request.cloudEnvId;
  }
  if (!Util.isUnset(request.effectTime)) {
    query['EffectTime'] = request.effectTime;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.unit)) {
    query['Unit'] = request.unit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccessPage',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建访问页面 
 *
 * @param request CreateAccessPageRequest
 * @return CreateAccessPageResponse
 */
async function createAccessPage(request: CreateAccessPageRequest): CreateAccessPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccessPageWithOptions(request, runtime);
}

model CreateAppInstanceGroupRequest {
  appCenterImageId?: string(name='AppCenterImageId', description='This parameter is required.', example='img-8z4nztpaqvay4****'),
  appInstanceGroupName?: string(name='AppInstanceGroupName'),
  appPackageType?: string(name='AppPackageType'),
  appPolicyId?: string(name='AppPolicyId'),
  authMode?: string(name='AuthMode', example='App', nullable=true),
  autoPay?: boolean(name='AutoPay', example='false'),
  autoRenew?: boolean(name='AutoRenew', example='false'),
  bizRegionId?: string(name='BizRegionId', description='This parameter is required.', example='cn-hangzhou'),
  chargeResourceMode?: string(name='ChargeResourceMode', description='This parameter is required.', example='Node'),
  chargeType?: string(name='ChargeType', description='This parameter is required.', example='PrePaid'),
  clusterId?: string(name='ClusterId'),
  network?: {
    domainRules?: [ 
      {
        domain?: string(name='Domain'),
        policy?: string(name='Policy'),
      }
    ](name='DomainRules'),
    ipExpireMinutes?: int32(name='IpExpireMinutes', example='60'),
    officeSiteId?: string(name='OfficeSiteId'),
    routes?: [ 
      {
        destination?: string(name='Destination', example='139.196.XX.XX/32'),
        mode?: string(name='Mode', example='Shared'),
      }
    ](name='Routes'),
    strategyType?: string(name='StrategyType', example='Shared'),
    vSwitchIds?: [ string ](name='VSwitchIds'),
  }(name='Network'),
  nodePool?: {
    maxIdleAppInstanceAmount?: int32(name='MaxIdleAppInstanceAmount'),
    maxScalingAmount?: int32(name='MaxScalingAmount', example='10'),
    nodeAmount?: int32(name='NodeAmount', example='1'),
    nodeCapacity?: int32(name='NodeCapacity', example='2'),
    nodeInstanceType?: string(name='NodeInstanceType'),
    recurrenceSchedules?: [ 
      {
        recurrenceType?: string(name='RecurrenceType', example='weekly'),
        recurrenceValues?: [ int32 ](name='RecurrenceValues'),
        timerPeriods?: [ 
          {
            amount?: int32(name='Amount', example='2'),
            endTime?: string(name='EndTime', example='15:00'),
            startTime?: string(name='StartTime', example='12:00'),
          }
        ](name='TimerPeriods'),
      }
    ](name='RecurrenceSchedules'),
    scalingDownAfterIdleMinutes?: int32(name='ScalingDownAfterIdleMinutes', example='5'),
    scalingStep?: int32(name='ScalingStep', example='2'),
    scalingUsageThreshold?: string(name='ScalingUsageThreshold', example='85'),
    strategyDisableDate?: string(name='StrategyDisableDate', example='2022-09-08'),
    strategyEnableDate?: string(name='StrategyEnableDate', example='2022-08-01'),
    strategyType?: string(name='StrategyType', example='NODE_FIXED'),
    warmUp?: boolean(name='WarmUp', example='false'),
  }(name='NodePool'),
  period?: int32(name='Period', description='This parameter is required.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='This parameter is required.'),
  preOpenAppId?: string(name='PreOpenAppId', example='cag-b2ron*******'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
  promotionId?: string(name='PromotionId', example='17440009****'),
  runtimePolicy?: {
    debugMode?: string(name='DebugMode'),
    perSessionPerApp?: boolean(name='PerSessionPerApp'),
    persistentAppInstanceScheduleMode?: string(name='PersistentAppInstanceScheduleMode', example='DYNAMIC', nullable=true),
    sessionPreOpen?: string(name='SessionPreOpen'),
    sessionType?: string(name='SessionType', description='会话类型。', example='NORMAL'),
    sessionUserGenerationMode?: string(name='SessionUserGenerationMode'),
  }(name='RuntimePolicy'),
  securityPolicy?: {
    resetAfterUnbind?: boolean(name='ResetAfterUnbind', example='true'),
    skipUserAuthCheck?: boolean(name='SkipUserAuthCheck', example='false'),
  }(name='SecurityPolicy'),
  sessionTimeout?: int32(name='SessionTimeout', description='This parameter is required.', example='15'),
  storagePolicy?: {
    storageTypeList?: [ string ](name='StorageTypeList'),
    userProfile?: {
      remoteStoragePath?: string(name='RemoteStoragePath'),
      remoteStorageType?: string(name='RemoteStorageType'),
      userProfileSwitch?: boolean(name='UserProfileSwitch'),
    }(name='UserProfile'),
  }(name='StoragePolicy'),
  subPayType?: string(name='SubPayType'),
  userDefinePolicy?: {
    customConfig?: string(name='CustomConfig'),
  }(name='UserDefinePolicy'),
  userInfo?: {
    type?: string(name='Type', example='Simple'),
  }(name='UserInfo'),
  users?: [ string ](name='Users'),
  videoPolicy?: {
    frameRate?: int32(name='FrameRate'),
    sessionResolutionHeight?: int32(name='SessionResolutionHeight'),
    sessionResolutionWidth?: int32(name='SessionResolutionWidth'),
    streamingMode?: string(name='StreamingMode'),
    terminalResolutionAdaptive?: boolean(name='TerminalResolutionAdaptive'),
    webrtc?: boolean(name='Webrtc'),
  }(name='VideoPolicy'),
}

model CreateAppInstanceGroupShrinkRequest {
  appCenterImageId?: string(name='AppCenterImageId', description='This parameter is required.', example='img-8z4nztpaqvay4****'),
  appInstanceGroupName?: string(name='AppInstanceGroupName'),
  appPackageType?: string(name='AppPackageType'),
  appPolicyId?: string(name='AppPolicyId'),
  authMode?: string(name='AuthMode', example='App', nullable=true),
  autoPay?: boolean(name='AutoPay', example='false'),
  autoRenew?: boolean(name='AutoRenew', example='false'),
  bizRegionId?: string(name='BizRegionId', description='This parameter is required.', example='cn-hangzhou'),
  chargeResourceMode?: string(name='ChargeResourceMode', description='This parameter is required.', example='Node'),
  chargeType?: string(name='ChargeType', description='This parameter is required.', example='PrePaid'),
  clusterId?: string(name='ClusterId'),
  networkShrink?: string(name='Network'),
  nodePoolShrink?: string(name='NodePool'),
  period?: int32(name='Period', description='This parameter is required.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='This parameter is required.'),
  preOpenAppId?: string(name='PreOpenAppId', example='cag-b2ron*******'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
  promotionId?: string(name='PromotionId', example='17440009****'),
  runtimePolicyShrink?: string(name='RuntimePolicy'),
  securityPolicyShrink?: string(name='SecurityPolicy'),
  sessionTimeout?: int32(name='SessionTimeout', description='This parameter is required.', example='15'),
  storagePolicyShrink?: string(name='StoragePolicy'),
  subPayType?: string(name='SubPayType'),
  userDefinePolicyShrink?: string(name='UserDefinePolicy'),
  userInfoShrink?: string(name='UserInfo'),
  users?: [ string ](name='Users'),
  videoPolicyShrink?: string(name='VideoPolicy'),
}

model CreateAppInstanceGroupResponseBody = {
  appInstanceGroupModel?: {
    appInstanceGroupId?: string(name='AppInstanceGroupId', example='aig-9ciijz60n4xsv****'),
    nodePoolId?: string(name='NodePoolId', example='rg-ew7va2g1wl3vm****'),
    orderId?: string(name='OrderId', example='12345****'),
  }(name='AppInstanceGroupModel'),
  requestId?: string(name='RequestId'),
}

model CreateAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary 创建云应用交付组
 *
 * @param tmpReq CreateAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppInstanceGroupResponse
 */
async function createAppInstanceGroupWithOptions(tmpReq: CreateAppInstanceGroupRequest, runtime: Util.RuntimeOptions): CreateAppInstanceGroupResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAppInstanceGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.network)) {
    request.networkShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.network, 'Network', 'json');
  }
  if (!Util.isUnset(tmpReq.nodePool)) {
    request.nodePoolShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodePool, 'NodePool', 'json');
  }
  if (!Util.isUnset(tmpReq.runtimePolicy)) {
    request.runtimePolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.runtimePolicy, 'RuntimePolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.securityPolicy)) {
    request.securityPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.securityPolicy, 'SecurityPolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.storagePolicy)) {
    request.storagePolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.storagePolicy, 'StoragePolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.userDefinePolicy)) {
    request.userDefinePolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userDefinePolicy, 'UserDefinePolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.userInfo)) {
    request.userInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userInfo, 'UserInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.videoPolicy)) {
    request.videoPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoPolicy, 'VideoPolicy', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.userDefinePolicyShrink)) {
    query['UserDefinePolicy'] = request.userDefinePolicyShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appCenterImageId)) {
    body['AppCenterImageId'] = request.appCenterImageId;
  }
  if (!Util.isUnset(request.appInstanceGroupName)) {
    body['AppInstanceGroupName'] = request.appInstanceGroupName;
  }
  if (!Util.isUnset(request.appPackageType)) {
    body['AppPackageType'] = request.appPackageType;
  }
  if (!Util.isUnset(request.appPolicyId)) {
    body['AppPolicyId'] = request.appPolicyId;
  }
  if (!Util.isUnset(request.authMode)) {
    body['AuthMode'] = request.authMode;
  }
  if (!Util.isUnset(request.autoPay)) {
    body['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    body['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    body['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeResourceMode)) {
    body['ChargeResourceMode'] = request.chargeResourceMode;
  }
  if (!Util.isUnset(request.chargeType)) {
    body['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.networkShrink)) {
    body['Network'] = request.networkShrink;
  }
  if (!Util.isUnset(request.nodePoolShrink)) {
    body['NodePool'] = request.nodePoolShrink;
  }
  if (!Util.isUnset(request.period)) {
    body['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    body['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.preOpenAppId)) {
    body['PreOpenAppId'] = request.preOpenAppId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.promotionId)) {
    body['PromotionId'] = request.promotionId;
  }
  if (!Util.isUnset(request.runtimePolicyShrink)) {
    body['RuntimePolicy'] = request.runtimePolicyShrink;
  }
  if (!Util.isUnset(request.securityPolicyShrink)) {
    body['SecurityPolicy'] = request.securityPolicyShrink;
  }
  if (!Util.isUnset(request.sessionTimeout)) {
    body['SessionTimeout'] = request.sessionTimeout;
  }
  if (!Util.isUnset(request.storagePolicyShrink)) {
    body['StoragePolicy'] = request.storagePolicyShrink;
  }
  if (!Util.isUnset(request.subPayType)) {
    body['SubPayType'] = request.subPayType;
  }
  if (!Util.isUnset(request.userInfoShrink)) {
    body['UserInfo'] = request.userInfoShrink;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }
  if (!Util.isUnset(request.videoPolicyShrink)) {
    body['VideoPolicy'] = request.videoPolicyShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建云应用交付组
 *
 * @param request CreateAppInstanceGroupRequest
 * @return CreateAppInstanceGroupResponse
 */
async function createAppInstanceGroup(request: CreateAppInstanceGroupRequest): CreateAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppInstanceGroupWithOptions(request, runtime);
}

model CreateImageFromAppInstanceGroupRequest {
  appCenterImageName?: string(name='AppCenterImageName', description='The image name.

This parameter is required.', example='test_name'),
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group. You can call the [ListAppInstanceGroup](https://help.aliyun.com/document_detail/428506.html) operation to obtain the ID.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model CreateImageFromAppInstanceGroupResponseBody = {
  imageId?: string(name='ImageId', description='The image ID.', example='img-bp13mu****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model CreateImageFromAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateImageFromAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Creates a new image by debugging the delivery group.
 *
 * @param request CreateImageFromAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateImageFromAppInstanceGroupResponse
 */
async function createImageFromAppInstanceGroupWithOptions(request: CreateImageFromAppInstanceGroupRequest, runtime: Util.RuntimeOptions): CreateImageFromAppInstanceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appCenterImageName)) {
    body['AppCenterImageName'] = request.appCenterImageName;
  }
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateImageFromAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a new image by debugging the delivery group.
 *
 * @param request CreateImageFromAppInstanceGroupRequest
 * @return CreateImageFromAppInstanceGroupResponse
 */
async function createImageFromAppInstanceGroup(request: CreateImageFromAppInstanceGroupRequest): CreateImageFromAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createImageFromAppInstanceGroupWithOptions(request, runtime);
}

model DeleteAccessPageRequest {
  accessPageId?: string(name='AccessPageId', example='a-075nu7bcqim2wvxli'),
}

model DeleteAccessPageResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  success?: string(name='Success', example='true'),
}

model DeleteAccessPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAccessPageResponseBody(name='body'),
}

/**
 * @summary 删除访问页面
 *
 * @param request DeleteAccessPageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAccessPageResponse
 */
async function deleteAccessPageWithOptions(request: DeleteAccessPageRequest, runtime: Util.RuntimeOptions): DeleteAccessPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPageId)) {
    query['AccessPageId'] = request.accessPageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAccessPage',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除访问页面
 *
 * @param request DeleteAccessPageRequest
 * @return DeleteAccessPageResponse
 */
async function deleteAccessPage(request: DeleteAccessPageRequest): DeleteAccessPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAccessPageWithOptions(request, runtime);
}

model DeleteAppInstanceGroupRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model DeleteAppInstanceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model DeleteAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a delivery group that uses the By Resource - Pay-as-you-go billing method.
 *
 * @description >  You cannot call this operation to delete a subscription delivery group.
 *
 * @param request DeleteAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppInstanceGroupResponse
 */
async function deleteAppInstanceGroupWithOptions(request: DeleteAppInstanceGroupRequest, runtime: Util.RuntimeOptions): DeleteAppInstanceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a delivery group that uses the By Resource - Pay-as-you-go billing method.
 *
 * @description >  You cannot call this operation to delete a subscription delivery group.
 *
 * @param request DeleteAppInstanceGroupRequest
 * @return DeleteAppInstanceGroupResponse
 */
async function deleteAppInstanceGroup(request: DeleteAppInstanceGroupRequest): DeleteAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppInstanceGroupWithOptions(request, runtime);
}

model DeleteAppInstancesRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group. You can call the [listAppInstanceGroup](https://help.aliyun.com/document_detail/428506.html) operation to obtain the ID.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  appInstanceIds?: [ string ](name='AppInstanceIds', description='The IDs of application instances.

This parameter is required.', nullable=false),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model DeleteAppInstancesResponseBody = {
  deleteAppInstanceModels?: [ 
    {
      appInstanceId?: string(name='AppInstanceId', description='The ID of the application instance.', example='ai-gbuea*****'),
      code?: string(name='Code', description='The error code.', example='InvalidParameter.ProductType'),
      message?: string(name='Message', description='The error message.', example='The parameter ProductType is invalid.'),
      success?: boolean(name='Success', description='Specifies whether the application instance is deleted.

Valid values:

*   true
*   false', example='true'),
    }
  ](name='DeleteAppInstanceModels', description='The data returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model DeleteAppInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppInstancesResponseBody(name='body'),
}

/**
 * @summary Deletes an application instance.
 *
 * @description Only application instances that are in the Initializing or Idle state can be deleted. The operation can be called only by specific customers.
 *
 * @param request DeleteAppInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppInstancesResponse
 */
async function deleteAppInstancesWithOptions(request: DeleteAppInstancesRequest, runtime: Util.RuntimeOptions): DeleteAppInstancesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstanceIds)) {
    body['AppInstanceIds'] = request.appInstanceIds;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppInstances',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application instance.
 *
 * @description Only application instances that are in the Initializing or Idle state can be deleted. The operation can be called only by specific customers.
 *
 * @param request DeleteAppInstancesRequest
 * @return DeleteAppInstancesResponse
 */
async function deleteAppInstances(request: DeleteAppInstancesRequest): DeleteAppInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppInstancesWithOptions(request, runtime);
}

model GetAccessPageSessionRequest {
  accessPageId?: string(name='AccessPageId', description='This parameter is required.', example='a-062wec3cwmayw****'),
  accessPageToken?: string(name='AccessPageToken', description='This parameter is required.', example='8141B1A674D48ACB8E5D2D6CE53FDB2F3CF8710A5F8F78578D5254BC6F******'),
  externalUserId?: string(name='ExternalUserId', example='Banca******'),
}

model GetAccessPageSessionResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    connectTicket?: string(name='ConnectTicket', example='DQpbRGVza3RvcF0NCkZvcmNlVGxzVHlwZT0xDQpHV1Rva2VuUGFydDE9MDBzQU5DTGVsZ0RqMnAyMGpZdUNkRDMrNTlLekpzUTRXNElPWVdjWGIwZ2QrUkNyais0ZGM3WUJGM1NBdVFJWWl2ejhaWDlvakh1cDJ4c0Vpc3lrQ1I4RVEzeDhIYXdCb2pRRDJReklaQTZIbU52VjdrRlNlWkxQTXV3Y0hNTEZTTkxKaDNOY1BtU0tVYTNqWVVUMFUyKzNqWDBRMXdLM29ZQnJaOFVoL2RWY0xpem5tWEhHTmE0THVGRCtrajloSWlFT0w3b2w4OHY1cjBPelpHZnh4aXlVbk1yQURnRHhoK1F6K3UvdXYxaFYyQ3UwVlduTHJ3cDNRM3hYWWtORW81N00xYWZ4cTJBdWplVmx3aGVxOHd4dDl2Y3NGVGMxNFpPL2hudWdoeGJkaz0NCkdXVG9rZW5QYXJ0Mj0NCkFzcEF1dGhUb2tlbj0wME5LTnlLZXE3UGpzNzNzeURrdEs2NUlaenpYb05WNWxnY3BjVTJMd2NKUEoyMk53WmlrSGNaaDdNVGk2azlLazNyeHFCd2FHZTlmc2NUbFljUDJ0MEVldXRha2paUklMM0x3a0RsT1BZZTZxYmtsay9STHFrajg4dWg0ZFZNTHE2QkF0WVRSeW9ZTC9WUHhaVWxyZEZOQT09DQpBZXNLZXlWZXJzaW9uPTE3MDEyMzk1ODc4NzcNCkdhdGV3YXlEb21haW5BZGRyZXNzPWd3LWFwcC1jbi1oYW5nemhvdS1pLWFwcC10ZXN0MC13aW4ud3V5aW5nLmFsaXl1bmNzLmNvbQ0KR2F0ZXdheUFkZHJlc3M9NDcuOTkuMjIzLjE0OQ0KR2F0ZXdheVBvcnQ9NTkxMg0KR2F0ZXdheVdzc1BvcnQ9ODAwOA0KU3RyZWFtVHlwZT0wDQpSdGNHd1Rva2VuPVAwMFJkc013dVdQVkt4MGtRYUNkSlY3MUc2OC9iaWFhSEJwVn******'),
    flowId?: string(name='FlowId', description='flow ID', example='e4fa0b4c18c5437a8b1746e7c228172e'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  success?: string(name='Success', example='true'),
}

model GetAccessPageSessionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAccessPageSessionResponseBody(name='body'),
}

/**
 * @summary 访客进入访问页面的匿名api
 *
 * @param request GetAccessPageSessionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAccessPageSessionResponse
 */
async function getAccessPageSessionWithOptions(request: GetAccessPageSessionRequest, runtime: Util.RuntimeOptions): GetAccessPageSessionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPageId)) {
    query['AccessPageId'] = request.accessPageId;
  }
  if (!Util.isUnset(request.accessPageToken)) {
    query['AccessPageToken'] = request.accessPageToken;
  }
  if (!Util.isUnset(request.externalUserId)) {
    query['ExternalUserId'] = request.externalUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAccessPageSession',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 访客进入访问页面的匿名api
 *
 * @param request GetAccessPageSessionRequest
 * @return GetAccessPageSessionResponse
 */
async function getAccessPageSession(request: GetAccessPageSessionRequest): GetAccessPageSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAccessPageSessionWithOptions(request, runtime);
}

model GetAppInstanceGroupRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='This parameter is required.', example='aig-9ciijz60n4xsv****'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
}

model GetAppInstanceGroupResponseBody = {
  appInstanceGroupModels?: {
    amount?: int32(name='Amount'),
    appCenterImageId?: string(name='AppCenterImageId', example='img-8z4nztpaqvay4****'),
    appCenterImageName?: string(name='AppCenterImageName', example='OfficeApps'),
    appInstanceGroupId?: string(name='AppInstanceGroupId', example='aig-9ciijz60n4xsv****'),
    appInstanceGroupName?: string(name='AppInstanceGroupName'),
    appInstanceType?: string(name='AppInstanceType', example='__dynamic__'),
    appInstanceTypeName?: string(name='AppInstanceTypeName', example='test001'),
    appPolicyId?: string(name='AppPolicyId', example='pg-g3k5wa2ms2****'),
    apps?: [ 
      {
        appIcon?: string(name='AppIcon'),
        appId?: string(name='AppId', example='ca-i87mycyn419nu****'),
        appName?: string(name='AppName'),
        appVersion?: string(name='AppVersion'),
        appVersionName?: string(name='AppVersionName'),
      }
    ](name='Apps'),
    chargeResourceMode?: string(name='ChargeResourceMode', example='Node'),
    chargeType?: string(name='ChargeType', example='PrePaid'),
    expiredTime?: string(name='ExpiredTime', example='2022-04-27T16:00:00.000+00:00'),
    gmtCreate?: string(name='GmtCreate', example='2022-04-26T15:06:16.000+00:00'),
    maxAmount?: int32(name='MaxAmount', example='10'),
    minAmount?: int32(name='MinAmount', example='1'),
    nodePool?: [ 
      {
        amount?: int32(name='Amount', example='2'),
        maxIdleAppInstanceAmount?: int32(name='MaxIdleAppInstanceAmount'),
        maxScalingAmount?: int32(name='MaxScalingAmount', example='8'),
        nodeAmount?: int32(name='NodeAmount', example='1'),
        nodeCapacity?: int32(name='NodeCapacity', example='2'),
        nodeInstanceType?: string(name='NodeInstanceType', example='appstreaming.vgpu.4c8g.2g'),
        nodePoolId?: string(name='NodePoolId', example='rg-g6922kced36hx****'),
        nodeTypeName?: string(name='NodeTypeName'),
        nodeUsed?: int32(name='NodeUsed', example='1'),
        recurrenceSchedules?: [ 
          {
            recurrenceType?: string(name='RecurrenceType', example='Weekly'),
            recurrenceValues?: [ int32 ](name='RecurrenceValues'),
            timerPeriods?: [ 
              {
                amount?: int32(name='Amount', example='5'),
                endTime?: string(name='EndTime', example='11:00'),
                startTime?: string(name='StartTime', example='09:30'),
              }
            ](name='TimerPeriods'),
          }
        ](name='RecurrenceSchedules'),
        scalingDownAfterIdleMinutes?: int32(name='ScalingDownAfterIdleMinutes', example='5'),
        scalingNodeAmount?: int32(name='ScalingNodeAmount', example='8'),
        scalingNodeUsed?: int32(name='ScalingNodeUsed', example='4'),
        scalingStep?: int32(name='ScalingStep', example='2'),
        scalingUsageThreshold?: string(name='ScalingUsageThreshold', example='85'),
        strategyDisableDate?: string(name='StrategyDisableDate', example='2022-09-08'),
        strategyEnableDate?: string(name='StrategyEnableDate', example='2022-08-01'),
        strategyType?: string(name='StrategyType', example='NODE_FIXED'),
        warmUp?: boolean(name='WarmUp', example='false'),
      }
    ](name='NodePool'),
    officeSiteId?: string(name='OfficeSiteId'),
    osType?: string(name='OsType', example='Windows'),
    otaInfo?: {
      newOtaVersion?: string(name='NewOtaVersion', example='0.0.1-D-20220630.11****'),
      otaVersion?: string(name='OtaVersion', example='0.0.1-D-20220615.11****'),
      taskId?: string(name='TaskId', example='ota-e49929gv8acz5****'),
    }(name='OtaInfo'),
    productType?: string(name='ProductType', example='CloudApp'),
    regionId?: string(name='RegionId', example='cn-hangzhou'),
    reserveAmountRatio?: string(name='ReserveAmountRatio', example='20'),
    reserveMaxAmount?: int32(name='ReserveMaxAmount', example='5'),
    reserveMinAmount?: int32(name='ReserveMinAmount', example='1'),
    resourceStatus?: string(name='ResourceStatus', example='AVAILABLE'),
    scalingDownAfterIdleMinutes?: int32(name='ScalingDownAfterIdleMinutes', example='5'),
    scalingStep?: int32(name='ScalingStep', example='10'),
    scalingUsageThreshold?: string(name='ScalingUsageThreshold', example='85'),
    sessionTimeout?: string(name='SessionTimeout', example='15'),
    sessionType?: string(name='SessionType'),
    skipUserAuthCheck?: boolean(name='SkipUserAuthCheck', example='false'),
    specId?: string(name='SpecId', example='spec-8o18t8uc31qib0****'),
    status?: string(name='Status', example='PUBLISHED'),
    tags?: [ 
      {
        key?: string(name='Key'),
        scope?: string(name='Scope'),
        value?: string(name='Value'),
      }
    ](name='Tags'),
  }(name='AppInstanceGroupModels', description='AppInstanceGroupModels'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model GetAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary 获取交付组详情
 *
 * @param request GetAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAppInstanceGroupResponse
 */
async function getAppInstanceGroupWithOptions(request: GetAppInstanceGroupRequest, runtime: Util.RuntimeOptions): GetAppInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取交付组详情
 *
 * @param request GetAppInstanceGroupRequest
 * @return GetAppInstanceGroupResponse
 */
async function getAppInstanceGroup(request: GetAppInstanceGroupRequest): GetAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppInstanceGroupWithOptions(request, runtime);
}

model GetConnectionTicketRequest {
  accessType?: string(name='AccessType', example='INTERNET', nullable=true),
  appId?: string(name='AppId', description='The application ID.

>  This parameter is required for the first call to this operation and optional for subsequent calls to the operation.', example='ca-e4s0puhmwi7v****'),
  appInstanceGroupIdList?: [ string ](name='AppInstanceGroupIdList', description='The delivery groups.

> *   If you configure this parameter, the system assigns application instances only among the specified authorized delivery groups. 
> *   This parameter is required if you configure `AppInstanceId` or `AppInstancePersistentId`.'),
  appInstanceId?: string(name='AppInstanceId', description='The ID of the application instance.

> *   If you configure this parameter, the system attempts to assign only the specified application instance.
> *   If you configure this parameter, you must also configure `AppInstanceGroupIdList` and the number of delivery groups specified by `AppInstanceGroupIdList` must be 1.', example='ai-1rznfnrvsa99d****'),
  appInstancePersistentId?: string(name='AppInstancePersistentId', description='The ID of the persistent session.', example='p-0bxls9m3cl7s****'),
  appStartParam?: string(name='AppStartParam', description='The parameters that are configured to start the application. For information about how to obtain these parameters, see [Obtain parameters configured to install and start an application](https://help.aliyun.com/document_detail/426045.html).', example='/q /n'),
  appVersion?: string(name='AppVersion', description='The application version. If you configure this parameter, only an application of the specified version is started. If you do not configure this parameter, an application of a random authorized version is started.', example='1.0.0'),
  bizRegionId?: string(name='BizRegionId', description='The region ID.

>  If you configure this parameter, the system assigns application instances only among the delivery groups that reside in the specified region.', example='cn-hangzhou'),
  endUserId?: string(name='EndUserId', description='The ID of the convenience account.

This parameter is required.', example='alice'),
  productType?: string(name='ProductType', description='The product type.

Valid values:

*   CloudApp: App Streaming
*   AndroidCloud: Cloud Phone

This parameter is required.', example='CloudApp'),
  taskId?: string(name='TaskId', description='The task ID.

>  This parameter is required for calls other than the first call to this operation. You can use this parameter to query the task status and connection credential.', example='28778acb-a469-4bc0-8e0f****'),
}

model GetConnectionTicketResponseBody = {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-53fvrq1oan****'),
  appInstanceId?: string(name='AppInstanceId', description='The ID of the application instance.', example='ai-7ybdeiyoeh5e****'),
  appInstancePersistentId?: string(name='AppInstancePersistentId', description='The ID of the persistent session.', example='p-0bxls9m3cl7s****'),
  bizRegionId?: string(name='BizRegionId', description='The region ID.', example='cn-hangzhou'),
  osType?: string(name='OsType', description='The operating system.

Valid value:

*   Windows: the Windows operating system', example='Windows'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  taskId?: string(name='TaskId', description='The task ID.', example='f3d1b31c-605e-4d04-a896****'),
  taskStatus?: string(name='TaskStatus', description='The task status.

Valid values:

*   Finished: The task is complete.
*   Failed: The task failed.
*   Running: The task is being executed.', example='Running'),
  tenantId?: long(name='TenantId', description='The ID of the Alibaba Cloud account.', example='148871678899****'),
  ticket?: string(name='Ticket', description='The credential that is used to connect to App Streaming.

>  This parameter is displayed for calls other than the first call to this operation.', example='DQpbRGVza3RvcF0NCkZvcmNlVGxzVHlwZT0xDQpHV1Rva2VuUGFydDE9MDAva09ROW1FUTU3dU****'),
}

model GetConnectionTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConnectionTicketResponseBody(name='body'),
}

/**
 * @summary Queries the credential that is used to connect to App Streaming.
 *
 * @description You must call this operation at least twice to obtain a connection credential.
 * The first time you call this operation, the system assigns an application instance to the specified convenience account and then starts the application. In this case, the ID of the started task, which is indicated by `TaskID`, is returned.
 * In subsequent calls, you must configure `TaskID` to query whether the task is completed. If the value of `TaskStatus` in the response is `Finished`, the connection credential, which is indicated by `Ticket`, is returned.
 *
 * @param request GetConnectionTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConnectionTicketResponse
 */
async function getConnectionTicketWithOptions(request: GetConnectionTicketRequest, runtime: Util.RuntimeOptions): GetConnectionTicketResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessType)) {
    body['AccessType'] = request.accessType;
  }
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appInstanceGroupIdList)) {
    body['AppInstanceGroupIdList'] = request.appInstanceGroupIdList;
  }
  if (!Util.isUnset(request.appInstanceId)) {
    body['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.appInstancePersistentId)) {
    body['AppInstancePersistentId'] = request.appInstancePersistentId;
  }
  if (!Util.isUnset(request.appStartParam)) {
    body['AppStartParam'] = request.appStartParam;
  }
  if (!Util.isUnset(request.appVersion)) {
    body['AppVersion'] = request.appVersion;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    body['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.endUserId)) {
    body['EndUserId'] = request.endUserId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetConnectionTicket',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the credential that is used to connect to App Streaming.
 *
 * @description You must call this operation at least twice to obtain a connection credential.
 * The first time you call this operation, the system assigns an application instance to the specified convenience account and then starts the application. In this case, the ID of the started task, which is indicated by `TaskID`, is returned.
 * In subsequent calls, you must configure `TaskID` to query whether the task is completed. If the value of `TaskStatus` in the response is `Finished`, the connection credential, which is indicated by `Ticket`, is returned.
 *
 * @param request GetConnectionTicketRequest
 * @return GetConnectionTicketResponse
 */
async function getConnectionTicket(request: GetConnectionTicketRequest): GetConnectionTicketResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConnectionTicketWithOptions(request, runtime);
}

model GetDebugAppInstanceRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group. You can call the `listAppInstanceGroup` operation to obtain the ID.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model GetDebugAppInstanceResponseBody = {
  appId?: string(name='AppId', description='The application ID.', example='__DEBUG_APP'),
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-9ciijz60n4xsv****'),
  appInstanceId?: string(name='AppInstanceId', description='The ID of the application instance.', example='ai-7ybdeiyoeh5e****'),
  appVersion?: string(name='AppVersion', description='The ID of the application version.', example='1.1'),
  authCode?: string(name='AuthCode', description='The authorization code. This authorization code is valid for 3 minutes and can be used only once, regardless of whether the authentication succeeds. If multiple authentication codes are generated for a user, only the latest authentication code takes effect.', example='e4e169bea1cc48e8afac53**********'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  userId?: string(name='UserId', description='The user ID.', example='__debug__'),
}

model GetDebugAppInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDebugAppInstanceResponseBody(name='body'),
}

/**
 * @summary Queries information that is used to debug an application instance.
 *
 * @param request GetDebugAppInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDebugAppInstanceResponse
 */
async function getDebugAppInstanceWithOptions(request: GetDebugAppInstanceRequest, runtime: Util.RuntimeOptions): GetDebugAppInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetDebugAppInstance',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information that is used to debug an application instance.
 *
 * @param request GetDebugAppInstanceRequest
 * @return GetDebugAppInstanceResponse
 */
async function getDebugAppInstance(request: GetDebugAppInstanceRequest): GetDebugAppInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDebugAppInstanceWithOptions(request, runtime);
}

model GetOtaTaskByTaskIdRequest {
  taskId?: string(name='TaskId', description='The ID of the OTA update task. You can call the [ListAppInstanceGroup](https://help.aliyun.com/document_detail/428506.html) operation to obtain the ID.

This parameter is required.', example='ota-be7jzm29wrrz5****'),
}

model GetOtaTaskByTaskIdResponseBody = {
  code?: string(name='Code', description='The error code.', example='OtaTask.Running'),
  message?: string(name='Message', description='The error message.', example='The task is running and cannot be sumitted.'),
  otaVersion?: string(name='OtaVersion', description='The OTA version.', example='0.0.1-R-20220708.110604'),
  releaseNote?: string(name='ReleaseNote', description='The version description.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  taskStartTime?: string(name='TaskStartTime', description='The execution time of the OTA update task. The time follows the ISO 8601 standard.

Use the UTC time format: yyyy-MM-ddTHH:mmZ', example='2022-08-04T14:36:00+08:00'),
}

model GetOtaTaskByTaskIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOtaTaskByTaskIdResponseBody(name='body'),
}

/**
 * @summary Queries the details of an over-the-air (OTA) update task, including the available versions and version description.
 *
 * @param request GetOtaTaskByTaskIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOtaTaskByTaskIdResponse
 */
async function getOtaTaskByTaskIdWithOptions(request: GetOtaTaskByTaskIdRequest, runtime: Util.RuntimeOptions): GetOtaTaskByTaskIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetOtaTaskByTaskId',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an over-the-air (OTA) update task, including the available versions and version description.
 *
 * @param request GetOtaTaskByTaskIdRequest
 * @return GetOtaTaskByTaskIdResponse
 */
async function getOtaTaskByTaskId(request: GetOtaTaskByTaskIdRequest): GetOtaTaskByTaskIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOtaTaskByTaskIdWithOptions(request, runtime);
}

model GetResourcePriceRequest {
  amount?: long(name='Amount', description='The number of resources to purchase.

This parameter is required.', example='1'),
  appInstanceType?: string(name='AppInstanceType', description='The type ID of the sessions that you purchase. You can call the `ListAppInstanceType` operation to obtain the ID.

You must specify one of AppInstanceType and NodeInstanceType. If you specify both of the parameters, the value of NodeInstanceType takes effect.', example='appstreaming.general'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region where the delivery group resides. For information about the supported regions, see [Limits](https://help.aliyun.com/document_detail/426036.html).

Valid values:

*   cn-shanghai: China (Shanghai).
*   cn-hangzhou: China (Hangzhou)

This parameter is required.', example='cn-hangzhou'),
  chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PostPaid: pay-as-you-go
*   PrePaid: subscription

This parameter is required.', example='PrePaid'),
  nodeInstanceType?: string(name='NodeInstanceType', description='The ID of the resource type that you purchase. You can call the [ListNodeInstanceType](https://help.aliyun.com/document_detail/428502.html) to obtain the ID.

You must specify one of AppInstanceType and NodeInstanceType. If you specify both of the parameters, the value of NodeInstanceType takes effect.

Valid values:

*   appstreaming.vgpu.8c16g.4g: WUYING - Graphics - 8 vCPUs, 16 GiB Memory, 4 GiB GPU Memory
*   appstreaming.general.8c16g: WUYING - General - 8 vCPUs, 16 GiB Memory
*   appstreaming.general.4c8g: WUYING - General - 4 vCPUs, 8 GiB Memory
*   appstreaming.vgpu.14c93g.12g: WUYING - Graphics - 14 vCPUs, 93 GiB Memory, 12 GiB GPU Memory.
*   appstreaming.vgpu.8c31g.16g: WUYING - Graphics - 8 vCPUs, 31 GiB Memory, 16 GiB GPU Memory', example='appstreaming.vgpu.4c8g.2g'),
  period?: long(name='Period', description='The subscription duration of resources. This parameter must be configured together with `PeriodUnit`.

This parameter is required.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration. This parameter must be configured together with `Period`. The following items describe valid values for the combinations of `Period` and `PeriodUnit`:

*   1 Week
*   1 Month
*   2 Month
*   3 Month
*   6 Month
*   1 Year
*   2 Year
*   3 Year

>  The value of this parameter is case-insensitive. For example, `Week` is valid and `week` is invalid. If you specify a value combination other than the preceding combinations, such as `2 Week`, the operation can still be called. However, an error occurs when you place the order.

This parameter is required.', example='Week'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model GetResourcePriceResponseBody = {
  code?: string(name='Code', description='The error code.', example='InvalidParameter.ProductType'),
  message?: string(name='Message', description='The error message.', example='The parameter ProductType is invalid.'),
  priceList?: [ 
    {
      price?: {
        currency?: string(name='Currency', description='The currency type.', example='CNY'),
        discountPrice?: string(name='DiscountPrice', description='The discount. The actual price is calculated based on the following formula: Actual price = Original price - Discount.', example='999.0'),
        originalPrice?: string(name='OriginalPrice', description='The original price.', example='6700'),
        promotions?: [ 
          {
            optionCode?: string(name='OptionCode', description='The coupon code.', example='coupon****'),
            promotionDesc?: string(name='PromotionDesc', description='The coupon description.'),
            promotionId?: string(name='PromotionId', description='The coupon ID.', example='1847709****'),
            promotionName?: string(name='PromotionName', description='The coupon name.'),
            selected?: boolean(name='Selected', description='Indicates whether the coupon was used.

Valid values:

*   true
*   false', example='true'),
          }
        ](name='Promotions', description='The coupon metadata.'),
        tradePrice?: string(name='TradePrice', description='The actual price. The actual price is calculated based on the following formula: Actual price = Original price - Discount.', example='5278.0'),
      }(name='Price', description='The price details.'),
      priceType?: string(name='PriceType', description='The price type.

Valid values:

*   Connected: in use
*   Standby: pending for use.', example='Standby'),
      rules?: [ 
        {
          description?: string(name='Description', description='The description of the price calculation rule.'),
          ruleId?: long(name='RuleId', description='The ID of the price calculation rule.', example='260904273633****'),
        }
      ](name='Rules', description='The price calculation rules.'),
    }
  ](name='PriceList', description='The price objects.

This parameter is returned only if a value is specified for AppInstanceType.'),
  priceModel?: {
    price?: {
      currency?: string(name='Currency', description='The currency type.', example='CNY'),
      discountPrice?: string(name='DiscountPrice', description='The discount. The actual price is calculated based on the following formula: Actual price = Original price - Discount.', example='1.00'),
      originalPrice?: string(name='OriginalPrice', description='The original price.', example='11.00'),
      promotions?: [ 
        {
          optionCode?: string(name='OptionCode', description='The coupon code.', example='coupon****'),
          promotionDesc?: string(name='PromotionDesc', description='The coupon description.'),
          promotionId?: string(name='PromotionId', description='The coupon ID.', example='17440009****'),
          promotionName?: string(name='PromotionName', description='The coupon name.'),
          selected?: boolean(name='Selected', description='Indicates whether the coupon was used.

Valid values:

*   true
*   false', example='true'),
        }
      ](name='Promotions', description='The coupon metadata.'),
      tradePrice?: string(name='TradePrice', description='The actual price. The actual price is calculated based on the following formula: Actual price = Original price - Discount.', example='10.00'),
    }(name='Price', description='The price details.'),
    rules?: [ 
      {
        description?: string(name='Description', description='The description of the price calculation rule.'),
        ruleId?: long(name='RuleId', description='The ID of the price calculation rule.', example='102002100393****'),
      }
    ](name='Rules', description='The price calculation rules.'),
  }(name='PriceModel', description='The price object.

This parameter is returned only if a value is specified for NodeInstanceType.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model GetResourcePriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourcePriceResponseBody(name='body'),
}

/**
 * @summary Queries resource prices.
 *
 * @param request GetResourcePriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourcePriceResponse
 */
async function getResourcePriceWithOptions(request: GetResourcePriceRequest, runtime: Util.RuntimeOptions): GetResourcePriceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.amount)) {
    query['Amount'] = request.amount;
  }
  if (!Util.isUnset(request.appInstanceType)) {
    query['AppInstanceType'] = request.appInstanceType;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.nodeInstanceType)) {
    query['NodeInstanceType'] = request.nodeInstanceType;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourcePrice',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries resource prices.
 *
 * @param request GetResourcePriceRequest
 * @return GetResourcePriceResponse
 */
async function getResourcePrice(request: GetResourcePriceRequest): GetResourcePriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourcePriceWithOptions(request, runtime);
}

model GetResourceRenewPriceRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group. You can call the [ListAppInstanceGroup](https://help.aliyun.com/document_detail/428506.html) operation to obtain the ID.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  period?: long(name='Period', description='The subscription duration of resources. This parameter must be configured together with `PeriodUnit`.

This parameter is required.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration. This parameter must be configured together with `Period`. The following items describe valid values for the combinations of `Period` and `PeriodUnit`:

*   1 Week
*   1 Month
*   2 Month
*   3 Month
*   6 Month
*   1 Year
*   2 Year
*   3 Year

>  The value of this parameter is case-insensitive. For example, `Week` is valid and `week` is invalid. If you specify a value combination other than the preceding combinations, such as `2 Week`, the operation can still be called. However, an error occurs when you place the order.

This parameter is required.', example='Week'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model GetResourceRenewPriceResponseBody = {
  data?: {
    price?: {
      currency?: string(name='Currency', description='The currency type.', example='CNY'),
      discountPrice?: string(name='DiscountPrice', description='The discount. The actual price is calculated based on the following formula: Actual price = Original price - Discount.', example='1'),
      originalPrice?: string(name='OriginalPrice', description='The original price.', example='11'),
      promotions?: [ 
        {
          optionCode?: string(name='OptionCode', description='The coupon code.', example='coupon****'),
          promotionDesc?: string(name='PromotionDesc', description='The coupon description.'),
          promotionId?: string(name='PromotionId', description='The coupon ID.', example='139965*****'),
          promotionName?: string(name='PromotionName', description='The coupon name.'),
          selected?: boolean(name='Selected', description='Indicates whether the coupon was used.

Valid values:

*   true
*   false', example='true'),
        }
      ](name='Promotions', description='The coupon description.'),
      tradePrice?: string(name='TradePrice', description='The actual price. The actual price is calculated based on the following formula: Actual price = Original price - Discount.', example='10'),
    }(name='Price', description='The price details.'),
    rules?: [ 
      {
        description?: string(name='Description', description='The description of the price calculation rule.'),
        ruleId?: long(name='RuleId', description='The ID of the price calculation rule.', example='20002****'),
      }
    ](name='Rules', description='The price calculation rules.'),
  }(name='Data', description='The price object.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model GetResourceRenewPriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceRenewPriceResponseBody(name='body'),
}

/**
 * @summary Queries the renewal prices of App Streaming resources.
 *
 * @param request GetResourceRenewPriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceRenewPriceResponse
 */
async function getResourceRenewPriceWithOptions(request: GetResourceRenewPriceRequest, runtime: Util.RuntimeOptions): GetResourceRenewPriceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceRenewPrice',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the renewal prices of App Streaming resources.
 *
 * @param request GetResourceRenewPriceRequest
 * @return GetResourceRenewPriceResponse
 */
async function getResourceRenewPrice(request: GetResourceRenewPriceRequest): GetResourceRenewPriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceRenewPriceWithOptions(request, runtime);
}

model ListAccessPagesRequest {
  accessPageId?: string(name='AccessPageId', example='a-062wec3cwmayw****'),
  accessPageName?: string(name='AccessPageName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  projectId?: string(name='ProjectId', example='p-065zdecaer07h****'),
  sortType?: string(name='SortType', example='ASC'),
}

model ListAccessPagesResponseBody = {
  code?: string(name='Code', example='200'),
  count?: string(name='Count', example='22'),
  data?: [ 
    {
      accessMode?: string(name='AccessMode'),
      accessPageId?: string(name='AccessPageId', example='a-062wec3cwmayw****'),
      accessPageName?: string(name='AccessPageName', example='notepad_test'),
      accessPageState?: string(name='AccessPageState', example='1'),
      accessUrl?: string(name='AccessUrl', example='id=a-062wec3cwmayw****&token=9E9A62937B0E41F4AEFE5EC9B238156CCDFB682954003AEE940A05FB2568****'),
      contentId?: string(name='ContentId', example='c-05to6wm3w5d53****'),
      contentName?: string(name='ContentName'),
      effectTime?: int32(name='EffectTime', example='168'),
      gmtCreate?: string(name='GmtCreate', example='2023-11-16T08:48:15.000+00:00'),
      projectId?: string(name='ProjectId', example='p-062wec3cwmayu****'),
      projectName?: string(name='ProjectName', example='notepad_demo'),
      unit?: string(name='Unit', example='Hour'),
      urlExpireTime?: string(name='UrlExpireTime', example='2023-11-23T08:48:15.000+00:00'),
    }
  ](name='Data'),
  message?: string(name='Message', example='InternalError'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='AF8361BD-5ECB-139A-B019-2E0350CC****'),
  success?: string(name='Success', example='true'),
}

model ListAccessPagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAccessPagesResponseBody(name='body'),
}

/**
 * @summary 访问页面分页查询
 *
 * @param request ListAccessPagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAccessPagesResponse
 */
async function listAccessPagesWithOptions(request: ListAccessPagesRequest, runtime: Util.RuntimeOptions): ListAccessPagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPageId)) {
    query['AccessPageId'] = request.accessPageId;
  }
  if (!Util.isUnset(request.accessPageName)) {
    query['AccessPageName'] = request.accessPageName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortType)) {
    query['SortType'] = request.sortType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAccessPages',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 访问页面分页查询
 *
 * @param request ListAccessPagesRequest
 * @return ListAccessPagesResponse
 */
async function listAccessPages(request: ListAccessPagesRequest): ListAccessPagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAccessPagesWithOptions(request, runtime);
}

model ListAppInstanceGroupRequest {
  appCenterImageId?: string(name='AppCenterImageId', description='The image ID of the app. You can obtain the ID from the Images page in the App Streaming console.', example='img-8z4nztpaqvay4****'),
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-9ciijz60n4xsv****'),
  appInstanceGroupName?: string(name='AppInstanceGroupName', description='The name of the delivery groups to query. Fuzzy match is used for queries. For example, if you set this parameter to `Office App`, all delivery groups whose names contain `Office App` are queried, such as `My Office Apps` and `Office App A`.'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region where the delivery group resides. For information about the supported regions, see [Limits](https://help.aliyun.com/document_detail/426036.html).

Valid values:

*   cn-shanghai: China (Shanghai)
*   cn-hangzhou: China (Hangzhou)', example='cn-hangzhou'),
  nodeInstanceType?: string(name='NodeInstanceType', description='The ID of the resource specification that you purchase. You can call the [ListNodeInstanceType](~~ListNodeInstanceType~~) operation to obtain the ID.', example='appstreaming.vgpu.4c8g.2g'),
  officeSiteId?: string(name='OfficeSiteId', example='cn-hongkong+dir-643067****'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. The value cannot be greater than `100`.', example='10'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
  regionId?: string(name='RegionId', description='The region ID', example='cn-hangzhou', deprecated=true),
  status?: [ string ](name='Status', description='The status of the delivery groups.'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag', nullable=true),
}

model ListAppInstanceGroupResponseBody = {
  appInstanceGroupModels?: [ 
    {
      amount?: int32(name='Amount', description='The number of subscription resources. Minimum value: 1.', example='1'),
      appCenterImageId?: string(name='AppCenterImageId', description='The image ID of the app.', example='img-8z4nztpaqvay4****'),
      appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-9ciijz60n4xsv****'),
      appInstanceGroupName?: string(name='AppInstanceGroupName', description='The name of the delivery group.'),
      appInstanceType?: string(name='AppInstanceType', description='The resource type of the delivery group.', example='__dynamic__'),
      appPolicyId?: string(name='AppPolicyId', description='The policy ID.', example='pg-g3k5wa2ms2****'),
      appPolicyImageCheck?: boolean(name='AppPolicyImageCheck', example='false'),
      appPolicyVersion?: string(name='AppPolicyVersion', example='CENTER'),
      apps?: [ 
        {
          appIcon?: string(name='AppIcon', description='The app icon.', example='https://app-center-icon-****.png'),
          appId?: string(name='AppId', description='The app ID.', example='ca-i87mycyn419nu****'),
          appName?: string(name='AppName', description='The app name.'),
          appVersion?: string(name='AppVersion', description='The app version.', example='1.0.0'),
          appVersionName?: string(name='AppVersionName', description='The name of the app version.'),
        }
      ](name='Apps', description='The apps.'),
      chargeResourceMode?: string(name='ChargeResourceMode', description='The sales mode.

Valid values:

*   AppInstance: by session
*   Node: by resource', example='Node'),
      chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PostPaid: pay-as-you-go
*   PrePaid: subscription', example='PrePaid'),
      expiredTime?: string(name='ExpiredTime', description='The time when the delivery group expires.', example='2022-04-27T16:00:00.000+00:00'),
      gmtCreate?: string(name='GmtCreate', description='The time when the delivery group was created.', example='2022-04-26T15:06:16.000+00:00'),
      maxAmount?: int32(name='MaxAmount', description='The maximum number of instances. Minimum value: 1.', example='10'),
      minAmount?: int32(name='MinAmount', description='The minimum number of instances. Minimum value: 1.', example='1'),
      nodePool?: [ 
        {
          amount?: int32(name='Amount', description='The number of resources purchased when the delivery group was created.', example='2'),
          maxIdleAppInstanceAmount?: int32(name='MaxIdleAppInstanceAmount', description='The maximum number of idle sessions. After you specify a value for this parameter, auto scale-out is triggered only if the number of idle sessions in the delivery group is smaller than the specified value and the session usage exceeds the value specified for `ScalingUsageThreshold`. Otherwise, the system determines that idle sessions in the delivery group are sufficient and does not perform auto scale-out.`` You can use this parameter to flexibly manage auto scaling and reduce costs.', example='3'),
          maxScalingAmount?: int32(name='MaxScalingAmount', description='The maximum number of resources that can be created for scale-out.', example='8'),
          nodeAmount?: int32(name='NodeAmount', description='The total number of subscription resources.', example='1'),
          nodeCapacity?: int32(name='NodeCapacity', description='The maximum number of sessions that can be connected to a resource at the same time. If a resource connects to a large number of sessions at the same time, user experience can be compromised. The value range varies based on the resource specification. The following items describe the value ranges of different resource types:

*   appstreaming.general.4c8g: 1 to 2
*   appstreaming.general.8c16g: 1 to 4
*   appstreaming.vgpu.8c16g.4g: 1 to 4
*   appstreaming.vgpu.8c31g.16g: 1 to 4
*   appstreaming.vgpu.14c93g.12g: 1 to 6', example='2'),
          nodeInstanceType?: string(name='NodeInstanceType', description='The ID of the resource specification that you purchase.', example='appstreaming.vgpu.4c8g.2g'),
          nodePoolId?: string(name='NodePoolId', description='The ID of the resource group.', example='rg-g6922kced36hx****'),
          nodeTypeName?: string(name='NodeTypeName', description='The name of the resource specification.'),
          nodeUsed?: int32(name='NodeUsed', description='The number of subscription resources that are in use.', example='1'),
          recurrenceSchedules?: [ 
            {
              recurrenceType?: string(name='RecurrenceType', description='The schedule type of the scaling policy. This parameter must be configured together with `RecurrenceValues`.``

Valid value:

*   weekly: The scaling policy is executed on specific days each week.', example='Weekly'),
              recurrenceValues?: [ int32 ](name='RecurrenceValues', description='The days of each week on which the scaling policy is executed.'),
              timerPeriods?: [ 
                {
                  amount?: int32(name='Amount', description='The number of destination resources.', example='5'),
                  endTime?: string(name='EndTime', description='The time when the scaling policy ends. Format: HH:mm.', example='11:00'),
                  startTime?: string(name='StartTime', description='The time when the scaling policy starts. Format: HH:mm.', example='09:30'),
                }
              ](name='TimerPeriods', description='The time periods during which the scaling policy can be executed.'),
            }
          ](name='RecurrenceSchedules', description='The intervals at which the scaling policy is executed.'),
          scalingDownAfterIdleMinutes?: int32(name='ScalingDownAfterIdleMinutes', description='The duration for which no session is connected. Unit: minutes. If no session is connected in the resources after the specified duration elapses, auto scale-in is triggered. Default value: 5.', example='5'),
          scalingNodeAmount?: int32(name='ScalingNodeAmount', description='The total number of scalable resources.', example='8'),
          scalingNodeUsed?: int32(name='ScalingNodeUsed', description='The number of scalable resources that are in use.', example='4'),
          scalingStep?: int32(name='ScalingStep', description='The number of resources that are created each time resources are scaled out. Valid values: 1 to 10.', example='2'),
          scalingUsageThreshold?: string(name='ScalingUsageThreshold', description='The upper limit of session usage. If the session usage exceeds the specified upper limit, auto scale-out is triggered. The session usage is calculated by using the following formula: `Session usage = Number of current sessions/(Total number of resources × Number of concurrent sessions) × 100%`.', example='85'),
          strategyDisableDate?: string(name='StrategyDisableDate', description='The expiration date of the scaling policy. Format: yyyy-MM-dd.', example='2022-09-08'),
          strategyEnableDate?: string(name='StrategyEnableDate', description='The effective date of the scaling policy. Format: yyyy-MM-dd.', example='2022-08-01'),
          strategyType?: string(name='StrategyType', description='The type of the scaling policy.

>  `NODE_SCALING_BY_USAGE` is returned for this parameter only if ChargeType is set to `PrePaid`. `NODE_SCALING_BY_SCHEDULE` is returned for this parameter only if ChargeType is set to `PostPaid`.

Valid values:

*   NODE_FIXED: No scalable resources are used.
*   NODE_SCALING_BY_SCHEDULE: Scheduled scaling is used.
*   NODE_SCALING_BY_USAGE: Resources are scaled based on usage.', example='NODE_FIXED'),
          warmUp?: boolean(name='WarmUp', description='Indicates whether resource prefetch is enabled.', example='false'),
        }
      ](name='NodePool', description='The resource groups.'),
      officeSiteId?: string(name='OfficeSiteId', example='cn-beijing+dir-172301****'),
      osType?: string(name='OsType', description='The type of the operating system.

Valid value:

*   Windows', example='Windows'),
      otaInfo?: {
        newOtaVersion?: string(name='NewOtaVersion', description='The new OTA version. A null value indicates that no new version is available.', example='0.0.1-D-20220630.11****'),
        otaVersion?: string(name='OtaVersion', description='The current OTA version.', example='0.0.1-D-20220615.11****'),
        taskId?: string(name='TaskId', description='The ID of the OTA update task.', example='ota-e49929gv8acz5****'),
      }(name='OtaInfo', description='The information about the over-the-air (OTA) update task.'),
      productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming', example='CloudApp'),
      regionId?: string(name='RegionId', description='The ID of the region where the delivery group resides. For information about the supported regions, see [Limits](https://help.aliyun.com/document_detail/426036.html).', example='cn-hangzhou'),
      reserveAmountRatio?: string(name='ReserveAmountRatio', description='The percentage of reserved instances. The value indicates the percentage of unused sessions in the delivery group. Valid values: 0 to 99.', example='20'),
      reserveMaxAmount?: int32(name='ReserveMaxAmount', description='The maximum number of reserved instances. The value indicates the maximum number of unused sessions in the delivery group. Minimum value: 1.', example='5'),
      reserveMinAmount?: int32(name='ReserveMinAmount', description='The minimum number of reserved instances. The value indicates the minimum number of unused sessions in the delivery group. Minimum value: 1.', example='1'),
      resourceStatus?: string(name='ResourceStatus', description='The resource status.

Valid values:

*   AVAILABLE
*   RELEASED
*   EXPIRED_IN_7_DAYS
*   UNAVAILABLE
*   UPGRADING
*   CREATING', example='AVAILABLE'),
      resourceTags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='department'),
          scope?: string(name='Scope', description='The tag type. Valid values: Custom System', example='Custom'),
          value?: string(name='Value', description='The tag value.', example='design'),
        }
      ](name='ResourceTags', description='The resource tags.'),
      scalingDownAfterIdleMinutes?: int32(name='ScalingDownAfterIdleMinutes', description='The duration for which no session is connected. Unit: minutes. If no session is connected in the resources after the specified duration elapses, auto scale-in is triggered. Minimum value: 0.', example='5'),
      scalingStep?: int32(name='ScalingStep', description='The number of sessions that are created each time the delivery group is scaled out. Minimum value: 1.', example='10'),
      scalingUsageThreshold?: string(name='ScalingUsageThreshold', description='The upper limit of session usage. If the session usage exceeds the specified upper limit, auto scale-out is triggered. The session usage rate is calculated by using the following formula: Session usage rate = Number of sessions in use/Total number of sessions × 100%. Valid values: 0 to 99.', example='85'),
      sessionTimeout?: string(name='SessionTimeout', description='The duration for which sessions are retained after disconnection. Unit: minutes. After an end user disconnects from a session, the session is closed only after the specified duration elapses. If you want to permanently retain sessions, set this parameter to `-1`. Valid values:-1 and 3 to 300. Default value: `15`.', example='15'),
      skipUserAuthCheck?: boolean(name='SkipUserAuthCheck', description='Indicates whether user permission verification is skipped.

Valid values:

*   true
*   false: This is the default value.', example='false'),
      specId?: string(name='SpecId', description='The specification ID that uniquely corresponds to the ID of the delivery group.', example='spec-8o18t8uc31qib0****'),
      status?: string(name='Status', description='The status of the delivery group.

Valid values:

*   PUBLISHED: The delivery group is published.
*   FAILED: The delivery group failed to be published.
*   MAINTAIN_FAILED: The delivery group failed to be updated.
*   EXPIRED: The delivery group is expired.
*   MAINTAINING: The delivery group is being updated.
*   CEASED: The delivery group has overdue payments.
*   EXPIRED_RECYCLING: The delivery group is expired and being recycled.
*   DEPLOYING: The delivery group is being published.', example='PUBLISHED'),
      tags?: [ 
        {
          key?: string(name='Key'),
          scope?: string(name='Scope'),
          value?: string(name='Value'),
        }
      ](name='Tags'),
    }
  ](name='AppInstanceGroupModels', description='The delivery groups.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='15'),
}

model ListAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Queries the details of multiple delivery groups that meet the query conditions.
 *
 * @param request ListAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppInstanceGroupResponse
 */
async function listAppInstanceGroupWithOptions(request: ListAppInstanceGroupRequest, runtime: Util.RuntimeOptions): ListAppInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appCenterImageId)) {
    query['AppCenterImageId'] = request.appCenterImageId;
  }
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstanceGroupName)) {
    query['AppInstanceGroupName'] = request.appInstanceGroupName;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.nodeInstanceType)) {
    query['NodeInstanceType'] = request.nodeInstanceType;
  }
  if (!Util.isUnset(request.officeSiteId)) {
    query['OfficeSiteId'] = request.officeSiteId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of multiple delivery groups that meet the query conditions.
 *
 * @param request ListAppInstanceGroupRequest
 * @return ListAppInstanceGroupResponse
 */
async function listAppInstanceGroup(request: ListAppInstanceGroupRequest): ListAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppInstanceGroupWithOptions(request, runtime);
}

model ListAppInstancesRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-4p5f8tj16yb8b****'),
  appInstanceId?: string(name='AppInstanceId', description='The ID of the application instance.', example='ai-azn3kmwruh1vl****'),
  appInstanceIdList?: [ string ](name='AppInstanceIdList', description='The IDs of the application instances. Up to 100 IDs can be specified.', nullable=false),
  includeDeleted?: boolean(name='IncludeDeleted', description='Specifies whether to query the information about deleted app instances. If you set this parameter to true, you must configure AppInstanceIdList. Otherwise, a parameter error is reported.

Valid values:

*   true
*   false', example='true'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: `1`. We recommend that you specify this parameter.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. The value cannot be greater than `100`. Default value: `20`. We recommend that you specify this parameter.', example='20'),
  status?: [ string ](name='Status', description='The status of the application instances.', nullable=false),
  userIdList?: [ string ](name='UserIdList', description='The user IDs. You can specify up to 100 IDs.'),
}

model ListAppInstancesResponseBody = {
  appInstanceModels?: [ 
    {
      appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-dk8p95irqfst9****'),
      appInstanceId?: string(name='AppInstanceId', description='The ID of the application instance.', example='ai-8dl7dzchklmka****'),
      bindInfo?: {
        endUserId?: string(name='EndUserId', description='The ID of the end user that is bound to the application instance.', example='app.test'),
        usageDuration?: long(name='UsageDuration', description='The use duration of the application instance. Unit: seconds.', example='2000'),
      }(name='BindInfo', description='The information about the binding between the application instance and end users.'),
      chargeType?: string(name='ChargeType', description='The billing method of the app instance. Valid values:

*   **PrePaid**: subscription.
*   **PostPaid**: pay-as-you-go

>  This parameter is returned only if the ChargeResourceMode parameter of the delivery group to which the app instance belongs is set to Node.', example='PostPaid'),
      gmtCreate?: string(name='GmtCreate', description='The time when the application instance was created.', example='2023-03-07T20:29:19.000+08:00'),
      gmtModified?: string(name='GmtModified', description='The time when the application instance was updated.', example='2023-03-07T20:29:19.000+08:00'),
      mainEthPublicIp?: string(name='MainEthPublicIp', description='The public IP address associated with the primary NIC. This value is returned only if `StrategyType` is set to `Mixed`.', example='10.13.13.211'),
      networkInterfaceIp?: string(name='NetworkInterfaceIp'),
      nodeId?: string(name='NodeId', description='The ID of the node on which the app instance runs.

>  This parameter is returned only if the ChargeResourceMode parameter of the delivery group to which the app instance belongs is set to Node.', example='i-bp13********'),
      sessionStatus?: string(name='SessionStatus', description='The session status. This parameter is returned only if the application instance is in the `RUNNING` state.

Valid values:

*   disconnect: disconnected
*   connect: connected', example='connect'),
      status?: string(name='Status', description='The status of the application instance.', example='BOUND'),
    }
  ](name='AppInstanceModels', description='The app instances.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. We recommend that you configure this parameter.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page. The value cannot be greater than `100`. We recommend that you configure this parameter.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='18'),
}

model ListAppInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppInstancesResponseBody(name='body'),
}

/**
 * @summary Queries the details of application instances in a delivery group, including the IDs, status, creation time, update time, session status, and public IP addresses associated with the primary NICs of the instances.
 *
 * @param request ListAppInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppInstancesResponse
 */
async function listAppInstancesWithOptions(request: ListAppInstancesRequest, runtime: Util.RuntimeOptions): ListAppInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.includeDeleted)) {
    query['IncludeDeleted'] = request.includeDeleted;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userIdList)) {
    query['UserIdList'] = request.userIdList;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceIdList)) {
    body['AppInstanceIdList'] = request.appInstanceIdList;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListAppInstances',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of application instances in a delivery group, including the IDs, status, creation time, update time, session status, and public IP addresses associated with the primary NICs of the instances.
 *
 * @param request ListAppInstancesRequest
 * @return ListAppInstancesResponse
 */
async function listAppInstances(request: ListAppInstancesRequest): ListAppInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppInstancesWithOptions(request, runtime);
}

model ListBindInfoRequest {
  appIdList?: [ string ](name='AppIdList'),
  appInstanceGroupIdList?: [ string ](name='AppInstanceGroupIdList'),
  appInstanceIdList?: [ string ](name='AppInstanceIdList'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  userIdList?: [ string ](name='UserIdList'),
  wyIdList?: [ string ](name='WyIdList'),
}

model ListBindInfoResponseBody = {
  bindInfoModels?: [ 
    {
      accountType?: string(name='AccountType', example='simple'),
      appId?: string(name='AppId', example='ca-fq738or6vd854****'),
      appInstanceGroupId?: string(name='AppInstanceGroupId', example='aig-0abxhr6ce35w8****'),
      appInstanceId?: string(name='AppInstanceId', example='ai-83oe276fre4l3****'),
      appVersion?: string(name='AppVersion', example='1.0'),
      productType?: string(name='ProductType', example='CloudApp'),
      regionId?: string(name='RegionId', example='cn-shanghai'),
      userId?: string(name='UserId', example='Alice'),
      wyId?: string(name='WyId', example='2ca6f5a93536****'),
    }
  ](name='BindInfoModels'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='AD2D0761-1FE5-549D-B169-D3F8D19C****'),
  totalCount?: int32(name='TotalCount', example='15'),
}

model ListBindInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBindInfoResponseBody(name='body'),
}

/**
 * @summary 查询绑定信息，支持分页
 *
 * @param request ListBindInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBindInfoResponse
 */
async function listBindInfoWithOptions(request: ListBindInfoRequest, runtime: Util.RuntimeOptions): ListBindInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appIdList)) {
    body['AppIdList'] = request.appIdList;
  }
  if (!Util.isUnset(request.appInstanceGroupIdList)) {
    body['AppInstanceGroupIdList'] = request.appInstanceGroupIdList;
  }
  if (!Util.isUnset(request.appInstanceIdList)) {
    body['AppInstanceIdList'] = request.appInstanceIdList;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userIdList)) {
    body['UserIdList'] = request.userIdList;
  }
  if (!Util.isUnset(request.wyIdList)) {
    body['WyIdList'] = request.wyIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListBindInfo',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询绑定信息，支持分页
 *
 * @param request ListBindInfoRequest
 * @return ListBindInfoResponse
 */
async function listBindInfo(request: ListBindInfoRequest): ListBindInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBindInfoWithOptions(request, runtime);
}

model ListNodeInstanceTypeRequest {
  bizRegionId?: string(name='BizRegionId', description='The ID of the region where the resource resides. For information about the supported regions, see [Limits](https://help.aliyun.com/document_detail/426036.html).

Valid values:

*   cn-shanghai: China (Shanghai)
*   cn-hangzhou: China (Hangzhou)', example='cn-hangzhou'),
  cpu?: float(name='Cpu'),
  gpu?: float(name='Gpu'),
  gpuMemory?: int32(name='GpuMemory'),
  language?: string(name='Language', description='The language that you want to use.

Valid values:

*   en-US: English (US)
*   zh-CN: Simplified Chinese', example='zh-CN'),
  memory?: int32(name='Memory'),
  nodeInstanceType?: string(name='NodeInstanceType', description='The resource type that you want to query. If you do not configure this parameter, all resource types are returned.', example='appstreaming.vgpu.4c8g.2g'),
  nodeInstanceTypeFamily?: string(name='NodeInstanceTypeFamily'),
  orderBy?: string(name='OrderBy'),
  osType?: string(name='OsType', description='The operating system that is supported.

Valid value:

*   Windows: the Windows operating system', example='Windows'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 1 to 100.

This parameter is required.', example='10'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
  sortType?: string(name='SortType'),
}

model ListNodeInstanceTypeResponseBody = {
  nodeInstanceTypeModels?: [ 
    {
      cpu?: string(name='Cpu', description='The number of vCPUs.', example='4'),
      gpu?: string(name='Gpu', description='The number of GPUs.', example='2'),
      gpuMemory?: long(name='GpuMemory', description='The GPU size. Unit: MB.', example='8192'),
      maxCapacity?: int32(name='MaxCapacity', description='The maximum number of sessions to which a resource can connect at the same time. If a resource connects to a large number of sessions at the same time, user experience can be compromised. The value range varies based on the resource type. The following items describe the value ranges of different resource types:

*   appstreaming.general.4c8g: 1 to 2
*   appstreaming.general.8c16g: 1 to 4
*   appstreaming.vgpu.8c16g.4g: 1 to 4
*   appstreaming.vgpu.8c31g.16g: 1 to 4
*   appstreaming.vgpu.14c93g.12g: 1 to 6', example='4'),
      memory?: long(name='Memory', description='The memory size. Unit: MB.', example='8192'),
      nodeInstanceType?: string(name='NodeInstanceType', description='The ID of the resource type.', example='appstreaming.vgpu.4c8g.2g'),
      nodeInstanceTypeFamily?: string(name='NodeInstanceTypeFamily', description='The resource type family.

Valid values:

*   appstreaming.general: WUYING - General
*   appstreaming.vgpu: WUYING - Graphics', example='appstreaming.vgpu'),
      nodeTypeName?: string(name='NodeTypeName', description='The name of the resource type.', example='WUYING - General - 4 vCPUs 8 GB Memory'),
    }
  ](name='NodeInstanceTypeModels', description='The resource types.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries on each page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='6'),
}

model ListNodeInstanceTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNodeInstanceTypeResponseBody(name='body'),
}

/**
 * @summary Queries the resource types that are available for purchase when you create a delivery group.
 *
 * @param request ListNodeInstanceTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNodeInstanceTypeResponse
 */
async function listNodeInstanceTypeWithOptions(request: ListNodeInstanceTypeRequest, runtime: Util.RuntimeOptions): ListNodeInstanceTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.gpu)) {
    query['Gpu'] = request.gpu;
  }
  if (!Util.isUnset(request.gpuMemory)) {
    query['GpuMemory'] = request.gpuMemory;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.nodeInstanceType)) {
    query['NodeInstanceType'] = request.nodeInstanceType;
  }
  if (!Util.isUnset(request.nodeInstanceTypeFamily)) {
    query['NodeInstanceTypeFamily'] = request.nodeInstanceTypeFamily;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.sortType)) {
    query['SortType'] = request.sortType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeInstanceType',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resource types that are available for purchase when you create a delivery group.
 *
 * @param request ListNodeInstanceTypeRequest
 * @return ListNodeInstanceTypeResponse
 */
async function listNodeInstanceType(request: ListNodeInstanceTypeRequest): ListNodeInstanceTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeInstanceTypeWithOptions(request, runtime);
}

model ListNodesRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-53fvrq1oanz6c****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 200.

This parameter is required.', example='10'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model ListNodesResponseBody = {
  count?: int32(name='Count', description='The total number of entries returned.', example='100'),
  nodeModels?: [ 
    {
      chargeType?: string(name='ChargeType', description='The billing method of the resource node.

>  This parameter is returned only if the ChargeResourceMode parameter of the delivery group to which the resource node belongs is set to Node.

Valid values:

*   PostPaid: pay-as-you-go
*   Prepaid: subscription', example='PostPaid'),
      nodeId?: string(name='NodeId', description='The ID of the resource node.

>  This parameter is returned only if the ChargeResourceMode parameter of the delivery group to which the resource node belongs is set to Node.', example='i-bp13********'),
    }
  ](name='NodeModels', description='The resource nodes.'),
  perPageSize?: int32(name='PerPageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  toPage?: int32(name='ToPage', description='The page number.', example='1'),
}

model ListNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNodesResponseBody(name='body'),
}

/**
 * @summary Queries resource nodes.
 *
 * @param request ListNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNodesResponse
 */
async function listNodesWithOptions(request: ListNodesRequest, runtime: Util.RuntimeOptions): ListNodesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListNodes',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries resource nodes.
 *
 * @param request ListNodesRequest
 * @return ListNodesResponse
 */
async function listNodes(request: ListNodesRequest): ListNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodesWithOptions(request, runtime);
}

model ListOtaTaskRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-53fvrq1oanz6c****'),
  otaType?: string(name='OtaType', description='The type of the OTA update task.

Valid values:

*   Fota: update of the system components of Alibaba Cloud Workspace

This parameter is required.', example='Fota'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page to return.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 1 to 100.

This parameter is required.', example='10'),
}

model ListOtaTaskResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries on each page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  taskList?: [ 
    {
      otaVersion?: string(name='OtaVersion', description='The OTA version.', example='0.0.1-R-20220708.110604'),
      taskDisplayStatus?: string(name='TaskDisplayStatus', description='The task status.

Valid values:

*   FAILED
*   RUNNING
*   TERMINATED
*   PART_FINISHED
*   STANDBY
*   FINISHED', example='RUNNING'),
      taskId?: string(name='TaskId', description='The task ID.', example='ota-be7jzm29wrrz5****'),
      taskStartTime?: string(name='TaskStartTime', description='The start time of the OTA update task. The time follows the ISO 8601 standard.

Use the UTC time format: yyyy-MM-ddTHH:mmZ', example='2022-08-04T14:36:00+08:00'),
    }
  ](name='TaskList', description='The OTA update tasks.'),
  totalCount?: int32(name='TotalCount', description='The total number of OTA update tasks.', example='6'),
}

model ListOtaTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOtaTaskResponseBody(name='body'),
}

/**
 * @summary Queries the information about over-the-air (OTA) update tasks.
 *
 * @param request ListOtaTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOtaTaskResponse
 */
async function listOtaTaskWithOptions(request: ListOtaTaskRequest, runtime: Util.RuntimeOptions): ListOtaTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.otaType)) {
    body['OtaType'] = request.otaType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListOtaTask',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about over-the-air (OTA) update tasks.
 *
 * @param request ListOtaTaskRequest
 * @return ListOtaTaskResponse
 */
async function listOtaTask(request: ListOtaTaskRequest): ListOtaTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOtaTaskWithOptions(request, runtime);
}

model ListPersistentAppInstancesRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='This parameter is required.', example='aig-0bxls9m9arax6****'),
  appInstancePersistentIds?: [ string ](name='AppInstancePersistentIds', nullable=false),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
}

model ListPersistentAppInstancesResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  persistentAppInstanceModels?: [ 
    {
      appInstanceGroupId?: string(name='AppInstanceGroupId', example='aig-0bxls9m9arax6****'),
      appInstanceId?: string(name='AppInstanceId', example='ai-azn3kmwruh1vl****'),
      appInstancePersistentId?: string(name='AppInstancePersistentId', example='p-0cc7s3mw2fg4j****'),
      appInstancePersistentName?: string(name='AppInstancePersistentName', example='test-persistent-name'),
      appInstancePersistentStatus?: string(name='AppInstancePersistentStatus', example='RUNNING'),
      appInstanceStatus?: string(name='AppInstanceStatus', example='RUNNING'),
      authorizedUsers?: [ string ](name='AuthorizedUsers'),
      gmtCreate?: string(name='GmtCreate', example='2025-03-13T03:22:18.000+00:00'),
    }
  ](name='PersistentAppInstanceModels'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  totalCount?: int32(name='TotalCount', example='15'),
}

model ListPersistentAppInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPersistentAppInstancesResponseBody(name='body'),
}

/**
 * @summary 查询交付组内持久会话列表
 *
 * @param request ListPersistentAppInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPersistentAppInstancesResponse
 */
async function listPersistentAppInstancesWithOptions(request: ListPersistentAppInstancesRequest, runtime: Util.RuntimeOptions): ListPersistentAppInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstancePersistentIds)) {
    query['AppInstancePersistentIds'] = request.appInstancePersistentIds;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPersistentAppInstances',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询交付组内持久会话列表
 *
 * @param request ListPersistentAppInstancesRequest
 * @return ListPersistentAppInstancesResponse
 */
async function listPersistentAppInstances(request: ListPersistentAppInstancesRequest): ListPersistentAppInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPersistentAppInstancesWithOptions(request, runtime);
}

model ListRegionsRequest {
  bizSource?: string(name='BizSource', description='>  This parameter is not publicly available.', example='null'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming', example='CloudApp'),
}

model ListRegionsResponseBody = {
  regionModels?: [ 
    {
      regionId?: string(name='regionId', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='RegionModels', description='The region IDs.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ListRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRegionsResponseBody(name='body'),
}

/**
 * @summary Queries the regions that are supported by App Streaming.
 *
 * @description >  All supported regions instead of available regions are returned by this operation. For more information, see [Supported regions](https://help.aliyun.com/document_detail/426036.html).
 *
 * @param request ListRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRegionsResponse
 */
async function listRegionsWithOptions(request: ListRegionsRequest, runtime: Util.RuntimeOptions): ListRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizSource)) {
    query['BizSource'] = request.bizSource;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRegions',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the regions that are supported by App Streaming.
 *
 * @description >  All supported regions instead of available regions are returned by this operation. For more information, see [Supported regions](https://help.aliyun.com/document_detail/426036.html).
 *
 * @param request ListRegionsRequest
 * @return ListRegionsResponse
 */
async function listRegions(request: ListRegionsRequest): ListRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRegionsWithOptions(request, runtime);
}

model ListSessionPackagesRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  projectId?: string(name='ProjectId', example='p-xxxxxxxxxxxx'),
  sessionPackageId?: string(name='SessionPackageId', example='tp-xxxxxxxx'),
  sessionPackageName?: string(name='SessionPackageName'),
  sortType?: string(name='SortType', example='ASC'),
  stateList?: [ int32 ](name='StateList'),
}

model ListSessionPackagesResponseBody = {
  data?: [ 
    {
      availableHours?: long(name='AvailableHours', example='500'),
      chargeType?: string(name='ChargeType'),
      deleteStatus?: int32(name='DeleteStatus', example='0'),
      gmtCreate?: string(name='GmtCreate', example='1701170196000'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='1701170203000'),
      instanceObject?: {
        expiredTime?: string(name='ExpiredTime', example='2024-05-28T16:00:00Z'),
        instanceId?: string(name='InstanceId', example='tp-xxxxxxxxxxx'),
        instanceType?: string(name='InstanceType', example='appstreaming.general.entry'),
        resourceId?: string(name='ResourceId', example='p-xxxxxxxxxx'),
        resourceType?: string(name='ResourceType', example='AppSessionPackage'),
        startTime?: string(name='StartTime', example='2023-11-28T04:14:07Z'),
        totalTime?: long(name='TotalTime', example='3600000'),
        usedTime?: long(name='UsedTime', example='1021'),
      }(name='InstanceObject'),
      maxHours?: long(name='MaxHours', example='1000'),
      maxSessions?: long(name='MaxSessions', example='100'),
      projectId?: string(name='ProjectId', example='p-xxxxxxxxxxxx'),
      projectName?: string(name='ProjectName'),
      region?: string(name='Region', example='cn-hangzhou'),
      sessionPackageId?: string(name='SessionPackageId', example='tp-xxxxxxxxx'),
      sessionPackageName?: string(name='SessionPackageName'),
      sessionPackageTypeId?: string(name='SessionPackageTypeId', example='0'),
      sessionSpec?: string(name='SessionSpec', example='appstreaming.general.entry'),
      sessionUsageRate?: long(name='SessionUsageRate', example='60'),
      state?: int32(name='State', example='4'),
      userIdentification?: long(name='UserIdentification', example='156xxxxxxxxxx'),
    }
  ](name='Data'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='100'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5Fxxxxxxxx'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ListSessionPackagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSessionPackagesResponseBody(name='body'),
}

/**
 * @summary 项目的会话包列表
 *
 * @param request ListSessionPackagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSessionPackagesResponse
 */
async function listSessionPackagesWithOptions(request: ListSessionPackagesRequest, runtime: Util.RuntimeOptions): ListSessionPackagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sessionPackageId)) {
    query['SessionPackageId'] = request.sessionPackageId;
  }
  if (!Util.isUnset(request.sessionPackageName)) {
    query['SessionPackageName'] = request.sessionPackageName;
  }
  if (!Util.isUnset(request.sortType)) {
    query['SortType'] = request.sortType;
  }
  if (!Util.isUnset(request.stateList)) {
    query['StateList'] = request.stateList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSessionPackages',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 项目的会话包列表
 *
 * @param request ListSessionPackagesRequest
 * @return ListSessionPackagesResponse
 */
async function listSessionPackages(request: ListSessionPackagesRequest): ListSessionPackagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSessionPackagesWithOptions(request, runtime);
}

model ListTagCloudResourcesRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Maximum value: 1000. Default value: 50.', example='50', nullable=true),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='ptnJAAAAAAAxNzE5OTEwNQ=='),
  resourceIds?: [ string ](name='ResourceIds', description='The resource IDs. You can specify up to 50 resource IDs. You do not need to specify this parameter if you set ResourceType to AliUid.'),
  resourceType?: string(name='ResourceType', description='The type of the cloud resource.

Valid values:

*   AppId: app ID.
*   WyId: Alibaba Cloud Workspace user ID.
*   AppInstanceGroupId: delivery group ID.
*   AliUid: tenant ID.

This parameter is required.', example='AppInstanceGroupId'),
  scope?: string(name='Scope', description='The tag type.

Valid values:

*   All (default): all tags.
*   Custom: custom tag.
*   System: system tag.', example='Custom', nullable=true),
}

model ListTagCloudResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='Indicates whether the next query is required.', example='AAAAAYRHtOLVQzCYj17y+OP7LZRrUJaF4rnBGQkWwMiVHlLZBB1w3Us37CVvhvyM0TXavA=='),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  resourceTags?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID.', example='aig-0001'),
      resourceType?: string(name='ResourceType', description='The type of the cloud resource.

Valid values:

*   AppId: app ID.
*   WyId: Alibaba Cloud Workspace user ID.
*   AppInstanceGroupId: delivery group ID.
*   AliUid: tenant ID.', example='AppInstanceGroupId'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='Resolution'),
          scope?: string(name='Scope', description='The tag type.

Valid values:

*   Custom: custom tag.
*   System: system tag.', example='Custom'),
          value?: string(name='Value', description='The tag value.', example='1080p'),
        }
      ](name='Tags', description='The tags.'),
    }
  ](name='ResourceTags', description='The tags added to the cloud resources.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries.', example='15'),
}

model ListTagCloudResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagCloudResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags added to one or more cloud resources.
 *
 * @param request ListTagCloudResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagCloudResourcesResponse
 */
async function listTagCloudResourcesWithOptions(request: ListTagCloudResourcesRequest, runtime: Util.RuntimeOptions): ListTagCloudResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.resourceIds)) {
    body['ResourceIds'] = request.resourceIds;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.scope)) {
    body['Scope'] = request.scope;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTagCloudResources',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tags added to one or more cloud resources.
 *
 * @param request ListTagCloudResourcesRequest
 * @return ListTagCloudResourcesResponse
 */
async function listTagCloudResources(request: ListTagCloudResourcesRequest): ListTagCloudResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagCloudResourcesWithOptions(request, runtime);
}

model ListTenantConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  tenantConfigModel?: {
    appInstanceGroupExpireRemind?: boolean(name='AppInstanceGroupExpireRemind', description='Indicates whether the resource expiration reminder feature is enabled.

Valid values:

*   true
*   false', example='true'),
  }(name='TenantConfigModel', description='The user configurations.'),
}

model ListTenantConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTenantConfigResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of the administrator account, such as whether the resource expiration reminder feature is enabled.
 *
 * @param request ListTenantConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTenantConfigResponse
 */
async function listTenantConfigWithOptions(runtime: Util.RuntimeOptions): ListTenantConfigResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListTenantConfig',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configurations of the administrator account, such as whether the resource expiration reminder feature is enabled.
 *
 * @return ListTenantConfigResponse
 */
async function listTenantConfig(): ListTenantConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTenantConfigWithOptions(runtime);
}

model LogOffAllSessionsInAppInstanceGroupRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model LogOffAllSessionsInAppInstanceGroupResponseBody = {
  code?: string(name='Code', description='The error code.', example='InvalidParameter.ProductType'),
  message?: string(name='Message', description='The error message.', example='The parameter ProductType is invalid.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model LogOffAllSessionsInAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LogOffAllSessionsInAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Closes all sessions in a pay-as-you-go delivery group for which a scheduled scaling policy is used.
 *
 * @description >  This operation can be called only if you use a pay-as-you-go delivery group for which a scheduled scaling policy is used and if you call the operation at a time other than the scheduled time.
 *
 * @param request LogOffAllSessionsInAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LogOffAllSessionsInAppInstanceGroupResponse
 */
async function logOffAllSessionsInAppInstanceGroupWithOptions(request: LogOffAllSessionsInAppInstanceGroupRequest, runtime: Util.RuntimeOptions): LogOffAllSessionsInAppInstanceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'LogOffAllSessionsInAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Closes all sessions in a pay-as-you-go delivery group for which a scheduled scaling policy is used.
 *
 * @description >  This operation can be called only if you use a pay-as-you-go delivery group for which a scheduled scaling policy is used and if you call the operation at a time other than the scheduled time.
 *
 * @param request LogOffAllSessionsInAppInstanceGroupRequest
 * @return LogOffAllSessionsInAppInstanceGroupResponse
 */
async function logOffAllSessionsInAppInstanceGroup(request: LogOffAllSessionsInAppInstanceGroupRequest): LogOffAllSessionsInAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return logOffAllSessionsInAppInstanceGroupWithOptions(request, runtime);
}

model ModifyAppInstanceGroupAttributeRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  appInstanceGroupName?: string(name='AppInstanceGroupName', description='The name of the delivery group.'),
  network?: {
    domainRules?: [ 
      {
        domain?: string(name='Domain', description='The domain name.', example='www.example.com'),
        policy?: string(name='Policy', description='The policy used for the domain name.

Valid values:

*   allow
*   block', example='block'),
      }
    ](name='DomainRules', description='The domain name rules.'),
  }(name='Network', description='The network settings.

>  If you want to use this parameter, submit a ticket.'),
  nodePool?: {
    nodeCapacity?: int32(name='NodeCapacity', description='The maximum number of sessions to which a resource can connect at the same time. If a resource connects to a large number of sessions at the same time, user experience can be compromised. The value range varies based on the resource type. The following items describe the value ranges of different resource types:

*   appstreaming.general.4c8g: 1 to 2
*   appstreaming.general.8c16g: 1 to 4
*   appstreaming.vgpu.8c16g.4g: 1 to 4
*   appstreaming.vgpu.8c31g.16g: 1 to 4
*   appstreaming.vgpu.14c93g.12g: 1 to 6', example='2'),
    nodePoolId?: string(name='NodePoolId', description='The ID of the resource group.', example='rg-ew7va2g1wl3vm****'),
  }(name='NodePool', description='The information about the resource group.'),
  perSessionPerApp?: boolean(name='PerSessionPerApp', description='Specifies whether only one application can be opened in a session.

*   After you enable this feature, the system assigns a session to each application if you open multiple applications in a delivery group. This consumes a larger number of sessions.

Valid values:

*   true
*   false', example='false'),
  preOpenAppId?: string(name='PreOpenAppId', description='The application ID of the pre-open application. If you set `PreOpenMode` to `SINGLE_APP`, you cannot leave this parameter empty.``', example='ca-b2ronxxd****'),
  preOpenMode?: string(name='PreOpenMode', description='The pre-open mode.

Valid values:

*   SINGLE_APP: enables the pre-open mode for a single application.
*   OFF: disables the pre-open mode. This is the default value.', example='OFF'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
  securityPolicy?: {
    resetAfterUnbind?: boolean(name='ResetAfterUnbind', description='Specifies whether to reset after unbinding from a delivery group.

Valid values:

*   true
*   false', example='true'),
    skipUserAuthCheck?: boolean(name='SkipUserAuthCheck', description='Specifies whether to skip user permission verification.

Valid values:

*   true
*   false: This is the default value.', example='false'),
  }(name='SecurityPolicy', description='The security policy.'),
  sessionTimeout?: int32(name='SessionTimeout', description='The duration for which sessions are retained after disconnection. Unit: minutes. After an end user disconnects from a session, the session is closed only after the specified duration elapses. If you want to permanently retain sessions, set this parameter to `-1`. Valid values:-1 and 3 to 300. Default value: `15`.', example='15'),
  storagePolicy?: {
    storageTypeList?: [ string ](name='StorageTypeList', description='The storage types.'),
    userProfile?: {
      fileSystemId?: string(name='FileSystemId', description='The ID of the File Storage NAS (NAS) file system used to store user data.', example='06ae94****'),
      userProfileSwitch?: boolean(name='UserProfileSwitch', description='Specifies whether user data roaming is enabled.

Valid values:

*   true
*   false', example='false'),
    }(name='UserProfile', description='The configurations of user data roaming.'),
    userProfileFollow?: {
      fileSystemId?: string(name='FileSystemId'),
      profileFollowSwitch?: boolean(name='ProfileFollowSwitch'),
    }(name='UserProfileFollow'),
  }(name='StoragePolicy', description='The storage policy.'),
}

model ModifyAppInstanceGroupAttributeShrinkRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  appInstanceGroupName?: string(name='AppInstanceGroupName', description='The name of the delivery group.'),
  networkShrink?: string(name='Network', description='The network settings.

>  If you want to use this parameter, submit a ticket.'),
  nodePoolShrink?: string(name='NodePool', description='The information about the resource group.'),
  perSessionPerApp?: boolean(name='PerSessionPerApp', description='Specifies whether only one application can be opened in a session.

*   After you enable this feature, the system assigns a session to each application if you open multiple applications in a delivery group. This consumes a larger number of sessions.

Valid values:

*   true
*   false', example='false'),
  preOpenAppId?: string(name='PreOpenAppId', description='The application ID of the pre-open application. If you set `PreOpenMode` to `SINGLE_APP`, you cannot leave this parameter empty.``', example='ca-b2ronxxd****'),
  preOpenMode?: string(name='PreOpenMode', description='The pre-open mode.

Valid values:

*   SINGLE_APP: enables the pre-open mode for a single application.
*   OFF: disables the pre-open mode. This is the default value.', example='OFF'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
  securityPolicyShrink?: string(name='SecurityPolicy', description='The security policy.'),
  sessionTimeout?: int32(name='SessionTimeout', description='The duration for which sessions are retained after disconnection. Unit: minutes. After an end user disconnects from a session, the session is closed only after the specified duration elapses. If you want to permanently retain sessions, set this parameter to `-1`. Valid values:-1 and 3 to 300. Default value: `15`.', example='15'),
  storagePolicyShrink?: string(name='StoragePolicy', description='The storage policy.'),
}

model ModifyAppInstanceGroupAttributeResponseBody = {
  code?: string(name='Code', description='The error code.', example='InvalidParameter.ProductType'),
  message?: string(name='Message', description='The error message.', example='The parameter ProductType is invalid.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ModifyAppInstanceGroupAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAppInstanceGroupAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the general policies of a delivery group, including the number of concurrent sessions and the retention period of disconnected sessions.
 *
 * @param tmpReq ModifyAppInstanceGroupAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAppInstanceGroupAttributeResponse
 */
async function modifyAppInstanceGroupAttributeWithOptions(tmpReq: ModifyAppInstanceGroupAttributeRequest, runtime: Util.RuntimeOptions): ModifyAppInstanceGroupAttributeResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyAppInstanceGroupAttributeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.network)) {
    request.networkShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.network, 'Network', 'json');
  }
  if (!Util.isUnset(tmpReq.nodePool)) {
    request.nodePoolShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodePool, 'NodePool', 'json');
  }
  if (!Util.isUnset(tmpReq.securityPolicy)) {
    request.securityPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.securityPolicy, 'SecurityPolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.storagePolicy)) {
    request.storagePolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.storagePolicy, 'StoragePolicy', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstanceGroupName)) {
    query['AppInstanceGroupName'] = request.appInstanceGroupName;
  }
  if (!Util.isUnset(request.nodePoolShrink)) {
    query['NodePool'] = request.nodePoolShrink;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.sessionTimeout)) {
    query['SessionTimeout'] = request.sessionTimeout;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.networkShrink)) {
    body['Network'] = request.networkShrink;
  }
  if (!Util.isUnset(request.perSessionPerApp)) {
    body['PerSessionPerApp'] = request.perSessionPerApp;
  }
  if (!Util.isUnset(request.preOpenAppId)) {
    body['PreOpenAppId'] = request.preOpenAppId;
  }
  if (!Util.isUnset(request.preOpenMode)) {
    body['PreOpenMode'] = request.preOpenMode;
  }
  if (!Util.isUnset(request.securityPolicyShrink)) {
    body['SecurityPolicy'] = request.securityPolicyShrink;
  }
  if (!Util.isUnset(request.storagePolicyShrink)) {
    body['StoragePolicy'] = request.storagePolicyShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAppInstanceGroupAttribute',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the general policies of a delivery group, including the number of concurrent sessions and the retention period of disconnected sessions.
 *
 * @param request ModifyAppInstanceGroupAttributeRequest
 * @return ModifyAppInstanceGroupAttributeResponse
 */
async function modifyAppInstanceGroupAttribute(request: ModifyAppInstanceGroupAttributeRequest): ModifyAppInstanceGroupAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppInstanceGroupAttributeWithOptions(request, runtime);
}

model ModifyAppPolicyRequest {
  appPolicyId?: string(name='AppPolicyId', description='This parameter is required.', example='pg-ee2znjktwgxu2****'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
  videoPolicy?: {
    frameRate?: int32(name='FrameRate', example='60'),
    sessionResolutionHeight?: int32(name='SessionResolutionHeight', example='1080'),
    sessionResolutionWidth?: int32(name='SessionResolutionWidth', example='1920'),
    streamingMode?: string(name='StreamingMode', example='video'),
    terminalResolutionAdaptive?: boolean(name='TerminalResolutionAdaptive', example='false'),
    visualQualityStrategy?: string(name='VisualQualityStrategy'),
    webrtc?: boolean(name='Webrtc', example='true'),
  }(name='VideoPolicy'),
}

model ModifyAppPolicyShrinkRequest {
  appPolicyId?: string(name='AppPolicyId', description='This parameter is required.', example='pg-ee2znjktwgxu2****'),
  productType?: string(name='ProductType', description='This parameter is required.', example='CloudApp'),
  videoPolicyShrink?: string(name='VideoPolicy'),
}

model ModifyAppPolicyResponseBody = {
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ModifyAppPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAppPolicyResponseBody(name='body'),
}

/**
 * @summary 修改策略信息
 *
 * @param tmpReq ModifyAppPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAppPolicyResponse
 */
async function modifyAppPolicyWithOptions(tmpReq: ModifyAppPolicyRequest, runtime: Util.RuntimeOptions): ModifyAppPolicyResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyAppPolicyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.videoPolicy)) {
    request.videoPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoPolicy, 'VideoPolicy', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appPolicyId)) {
    query['AppPolicyId'] = request.appPolicyId;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.videoPolicyShrink)) {
    query['VideoPolicy'] = request.videoPolicyShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAppPolicy',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改策略信息
 *
 * @param request ModifyAppPolicyRequest
 * @return ModifyAppPolicyResponse
 */
async function modifyAppPolicy(request: ModifyAppPolicyRequest): ModifyAppPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppPolicyWithOptions(request, runtime);
}

model ModifyNodePoolAmountRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  nodePool?: {
    nodeAmount?: int32(name='NodeAmount', description='The total number of subscription nodes after the change.

This parameter is required.', example='1'),
    prePaidNodeAmountModifyMode?: string(name='PrePaidNodeAmountModifyMode', description='The change mode of subscription nodes.

Valid value:

*   EXPAND_FROM_POST_PAID_EXPLICIT: changes from specified pay-as-you-go nodes', example='EXPAND_FROM_POST_PAID_EXPLICIT'),
    prePaidNodeAmountModifyNodeIds?: [ string ](name='PrePaidNodeAmountModifyNodeIds', description='The nodes for which you want to change the billing method.'),
  }(name='NodePool', description='The parameters related to the configuration change of the node pool.

This parameter is required.'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model ModifyNodePoolAmountShrinkRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  nodePoolShrink?: string(name='NodePool', description='The parameters related to the configuration change of the node pool.

This parameter is required.'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model ModifyNodePoolAmountResponseBody = {
  data?: {
    orderId?: string(name='OrderId', description='The order ID.', example='23429322113****'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ModifyNodePoolAmountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyNodePoolAmountResponseBody(name='body'),
}

/**
 * @summary Changes the number of nodes in a subscription delivery group.
 *
 * @param tmpReq ModifyNodePoolAmountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyNodePoolAmountResponse
 */
async function modifyNodePoolAmountWithOptions(tmpReq: ModifyNodePoolAmountRequest, runtime: Util.RuntimeOptions): ModifyNodePoolAmountResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyNodePoolAmountShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.nodePool)) {
    request.nodePoolShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodePool, 'NodePool', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.nodePoolShrink)) {
    body['NodePool'] = request.nodePoolShrink;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyNodePoolAmount',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the number of nodes in a subscription delivery group.
 *
 * @param request ModifyNodePoolAmountRequest
 * @return ModifyNodePoolAmountResponse
 */
async function modifyNodePoolAmount(request: ModifyNodePoolAmountRequest): ModifyNodePoolAmountResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyNodePoolAmountWithOptions(request, runtime);
}

model ModifyNodePoolAttributeRequest {
  bizRegionId?: string(name='BizRegionId', example='cn-hangzhou'),
  nodeCapacity?: int32(name='NodeCapacity', example='2'),
  nodePoolStrategy?: {
    maxIdleAppInstanceAmount?: int32(name='MaxIdleAppInstanceAmount'),
    maxScalingAmount?: int32(name='MaxScalingAmount', example='10'),
    nodeAmount?: int32(name='NodeAmount', description='购买资源的数量。取值范围：1~100。

> 
- 若为包年包月资源，则该参数不可修改。
- 若为按量付费资源，则当弹性模式（`StrategyType`）为固定数量（`NODE_FIXED`）或自动扩缩容（`NODE_SCALING_BY_USAGE`）时该参数可修改。', example='1'),
    recurrenceSchedules?: [ 
      {
        recurrenceType?: string(name='RecurrenceType', description='策略执行周期的类型。必须同时指定`RecurrenceType`和`RecurrenceValues`。', example='weekly'),
        recurrenceValues?: [ int32 ](name='RecurrenceValues', description='策略执行周期的数值列表。'),
        timerPeriods?: [ 
          {
            amount?: int32(name='Amount', description='资源数量。', example='2'),
            endTime?: string(name='EndTime', description='结束时间。格式为HH:mm。', example='15:00'),
            startTime?: string(name='StartTime', description='开始时间。格式为HH:mm。', example='12:00'),
          }
        ](name='TimerPeriods', description='策略执行周期的时间段列表。时间段设置要求：

- 最多可添加3个时间段。
- 时间段之间不重叠。
- 时间段之间的间隔大于或等于5分钟。
- 单个时间段的时长大于或等于15分钟。
- 所有时间段累计不跨天。'),
      }
    ](name='RecurrenceSchedules', description='策略执行周期列表。`StrategyType`（弹性模式）设为`NODE_SCALING_BY_SCHEDULE`（定时扩缩容）时，该字段必填。'),
    scalingDownAfterIdleMinutes?: int32(name='ScalingDownAfterIdleMinutes', example='5'),
    scalingStep?: int32(name='ScalingStep', example='2'),
    scalingUsageThreshold?: string(name='ScalingUsageThreshold', example='85'),
    strategyDisableDate?: string(name='StrategyDisableDate', description='策略失效日期。格式为：yyyy-MM-dd。失效日期与生效日期的间隔必须介于7天到1年之间（含7天和1年）。`StrategyType`（弹性模式）设为`NODE_SCALING_BY_SCHEDULE`（定时扩缩容）时，该字段必填。', example='2023-01-19'),
    strategyEnableDate?: string(name='StrategyEnableDate', description='策略生效日期。格式为：yyyy-MM-dd。该日期必须大于或等于当前日期。`StrategyType`（弹性模式）设为`NODE_SCALING_BY_SCHEDULE`（定时扩缩容）时，该字段必填。', example='2023-01-05'),
    strategyType?: string(name='StrategyType'),
    warmUp?: boolean(name='WarmUp', description='是否开启资源预热策略。`StrategyType`（弹性模式）设为`NODE_SCALING_BY_SCHEDULE`（定时扩缩容）时，该字段必填。', example='false'),
  }(name='NodePoolStrategy'),
  poolId?: string(name='PoolId', example='rg-ew7va2g1wl3vm****'),
  productType?: string(name='ProductType', description='产品类型。', example='CloudApp'),
}

model ModifyNodePoolAttributeShrinkRequest {
  bizRegionId?: string(name='BizRegionId', example='cn-hangzhou'),
  nodeCapacity?: int32(name='NodeCapacity', example='2'),
  nodePoolStrategyShrink?: string(name='NodePoolStrategy'),
  poolId?: string(name='PoolId', example='rg-ew7va2g1wl3vm****'),
  productType?: string(name='ProductType', description='产品类型。', example='CloudApp'),
}

model ModifyNodePoolAttributeResponseBody = {
  code?: string(name='Code', example='InvalidParameter.PoolId'),
  message?: string(name='Message', example='The parameter PoolId is invalid.'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ModifyNodePoolAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyNodePoolAttributeResponseBody(name='body'),
}

/**
 * @param tmpReq ModifyNodePoolAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyNodePoolAttributeResponse
 */
async function modifyNodePoolAttributeWithOptions(tmpReq: ModifyNodePoolAttributeRequest, runtime: Util.RuntimeOptions): ModifyNodePoolAttributeResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyNodePoolAttributeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.nodePoolStrategy)) {
    request.nodePoolStrategyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodePoolStrategy, 'NodePoolStrategy', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizRegionId)) {
    body['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.nodeCapacity)) {
    body['NodeCapacity'] = request.nodeCapacity;
  }
  if (!Util.isUnset(request.nodePoolStrategyShrink)) {
    body['NodePoolStrategy'] = request.nodePoolStrategyShrink;
  }
  if (!Util.isUnset(request.poolId)) {
    body['PoolId'] = request.poolId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyNodePoolAttribute',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyNodePoolAttributeRequest
 * @return ModifyNodePoolAttributeResponse
 */
async function modifyNodePoolAttribute(request: ModifyNodePoolAttributeRequest): ModifyNodePoolAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyNodePoolAttributeWithOptions(request, runtime);
}

model ModifyTenantConfigRequest {
  appInstanceGroupExpireRemind?: boolean(name='AppInstanceGroupExpireRemind', description='Specifies whether to enable the resource expiration reminder feature.

Valid values:

*   true
*   false', example='true'),
}

model ModifyTenantConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ModifyTenantConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantConfigResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of the administrator account, such as whether to enable the resource expiration reminder feature.
 *
 * @param request ModifyTenantConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantConfigResponse
 */
async function modifyTenantConfigWithOptions(request: ModifyTenantConfigRequest, runtime: Util.RuntimeOptions): ModifyTenantConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupExpireRemind)) {
    body['AppInstanceGroupExpireRemind'] = request.appInstanceGroupExpireRemind;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantConfig',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of the administrator account, such as whether to enable the resource expiration reminder feature.
 *
 * @param request ModifyTenantConfigRequest
 * @return ModifyTenantConfigResponse
 */
async function modifyTenantConfig(request: ModifyTenantConfigRequest): ModifyTenantConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantConfigWithOptions(request, runtime);
}

model PageListAppInstanceGroupUserRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. We recommend that you configure this parameter.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to be return on each page. The value cannot be greater than `100`. We recommend that you configure this parameter.', example='10'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model PageListAppInstanceGroupUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  users?: [ string ](name='Users', description='The users.'),
}

model PageListAppInstanceGroupUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PageListAppInstanceGroupUserResponseBody(name='body'),
}

/**
 * @summary Queries the assigned users that are added to a delivery group by page.
 *
 * @param request PageListAppInstanceGroupUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PageListAppInstanceGroupUserResponse
 */
async function pageListAppInstanceGroupUserWithOptions(request: PageListAppInstanceGroupUserRequest, runtime: Util.RuntimeOptions): PageListAppInstanceGroupUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PageListAppInstanceGroupUser',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the assigned users that are added to a delivery group by page.
 *
 * @param request PageListAppInstanceGroupUserRequest
 * @return PageListAppInstanceGroupUserResponse
 */
async function pageListAppInstanceGroupUser(request: PageListAppInstanceGroupUserRequest): PageListAppInstanceGroupUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return pageListAppInstanceGroupUserWithOptions(request, runtime);
}

model RenewAppInstanceGroupRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment.

Valid values:

*   true
*   false: manual payment. This is the default value.', example='false'),
  period?: int32(name='Period', description='The subscription duration of resources. This parameter must be configured together with `PeriodUnit`.

This parameter is required.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration. This parameter must be configured together with `Period`. The following items describe valid values for the combinations of `Period` and `PeriodUnit`:

*   1 Week
*   1 Month
*   2 Month
*   3 Month
*   6 Month
*   1 Year
*   2 Year
*   3 Year

>  The value of this parameter is case-insensitive. For example, `Week` is valid and `week` is invalid. If you specify a value combination other than the preceding combinations, such as `2 Week`, the operation can still be called. However, an error occurs when you place the order.

This parameter is required.', example='Week'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
  promotionId?: string(name='PromotionId', description='The promotion ID. You can call the [GetResourcePrice](https://help.aliyun.com/document_detail/428503.html) operation to obtain the ID.', example='17440009****'),
}

model RenewAppInstanceGroupResponseBody = {
  code?: string(name='Code', description='The error code.', example='InvalidParameter.ProductType'),
  message?: string(name='Message', description='The error message.', example='The parameter ProductType is invalid.'),
  orderId?: string(name='OrderId', description='The order ID.', example='123456****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model RenewAppInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewAppInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Renews a delivery group.
 *
 * @description Before you call this operation, make sure that you fully understand the [billing methods and prices](https://help.aliyun.com/document_detail/426039.html) of App Streaming.
 *
 * @param request RenewAppInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewAppInstanceGroupResponse
 */
async function renewAppInstanceGroupWithOptions(request: RenewAppInstanceGroupRequest, runtime: Util.RuntimeOptions): RenewAppInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.promotionId)) {
    query['PromotionId'] = request.promotionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RenewAppInstanceGroup',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Renews a delivery group.
 *
 * @description Before you call this operation, make sure that you fully understand the [billing methods and prices](https://help.aliyun.com/document_detail/426039.html) of App Streaming.
 *
 * @param request RenewAppInstanceGroupRequest
 * @return RenewAppInstanceGroupResponse
 */
async function renewAppInstanceGroup(request: RenewAppInstanceGroupRequest): RenewAppInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewAppInstanceGroupWithOptions(request, runtime);
}

model TagCloudResourcesRequest {
  resourceIds?: [ string ](name='ResourceIds'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='AppInstanceGroupId'),
  tags?: [ 
    {
      key?: string(name='Key', description='This parameter is required.', example='Resolution'),
      value?: string(name='Value', description='This parameter is required.', example='720p'),
    }
  ](name='Tags', description='This parameter is required.'),
}

model TagCloudResourcesResponseBody = {
  failedResources?: [ 
    {
      code?: string(name='Code', example='TAG_KEY_DUPLICATED'),
      message?: string(name='Message', example='Duplicate tag keys exist.'),
      resourceId?: string(name='ResourceId', example='aig-001'),
      resourceType?: string(name='ResourceType', example='AppInstanceGroupId'),
      tags?: [ 
        {
          key?: string(name='Key', example='System/Scheduler/STOP_NEW_USER_CONNECTION'),
          scope?: string(name='Scope', example='System'),
          value?: string(name='Value', example='true'),
        }
      ](name='Tags'),
    }
  ](name='FailedResources'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model TagCloudResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagCloudResourcesResponseBody(name='body'),
}

/**
 * @summary 为云资源创建并绑定标签
 *
 * @param request TagCloudResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagCloudResourcesResponse
 */
async function tagCloudResourcesWithOptions(request: TagCloudResourcesRequest, runtime: Util.RuntimeOptions): TagCloudResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceIds)) {
    body['ResourceIds'] = request.resourceIds;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tags)) {
    body['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TagCloudResources',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 为云资源创建并绑定标签
 *
 * @param request TagCloudResourcesRequest
 * @return TagCloudResourcesResponse
 */
async function tagCloudResources(request: TagCloudResourcesRequest): TagCloudResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagCloudResourcesWithOptions(request, runtime);
}

model UnbindRequest {
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group. You can call the [GetConnectionTicket](~~GetConnectionTicket~~) operation to obtain the ID.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  appInstanceId?: string(name='AppInstanceId', description='The session ID. You can call the [GetConnectionTicket](~~GetConnectionTicket~~) operation to obtain the ID.', example='ai-d297eyf83g5ni****'),
  appInstancePersistentId?: string(name='AppInstancePersistentId', description='The ID of the persistent session. You can call the [GetConnectionTicket](~~GetConnectionTicket~~) operation to obtain the ID.', example='p-0bxls9m3cl7s****'),
  endUserId?: string(name='EndUserId', description='The username.

This parameter is required.', example='alice'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model UnbindResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model UnbindResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindResponseBody(name='body'),
}

/**
 * @summary Unbinds a user and a session.
 *
 * @param request UnbindRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindResponse
 */
async function unbindWithOptions(request: UnbindRequest, runtime: Util.RuntimeOptions): UnbindResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appInstanceGroupId)) {
    body['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.appInstanceId)) {
    body['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.appInstancePersistentId)) {
    body['AppInstancePersistentId'] = request.appInstancePersistentId;
  }
  if (!Util.isUnset(request.endUserId)) {
    body['EndUserId'] = request.endUserId;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Unbind',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Unbinds a user and a session.
 *
 * @param request UnbindRequest
 * @return UnbindResponse
 */
async function unbind(request: UnbindRequest): UnbindResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindWithOptions(request, runtime);
}

model UntagCloudResourcesRequest {
  resourceIds?: [ string ](name='ResourceIds', description='The resource IDs. You can specify up to 50 resource IDs. You do not need to specify this parameter if you set ResourceType to AliUid.'),
  resourceType?: string(name='ResourceType', description='The type of the resource from which you want to remove tags.

Valid values:

*   AppId: app ID.
*   WyId: Alibaba Cloud Workspace user ID.
*   AppInstanceGroupId: delivery group ID.
*   AliUid: tenant ID.

This parameter is required.', example='AppInstanceGroupId'),
  tagKeys?: [ string ](name='TagKeys', description='The tags that you want to remove from the cloud resources. System and custom tags are supported. You can specify up to 10 tags.

Valid values for system tags:

*   `System/Scheduler/GRAYSCALE`: canary tags.
*   `System/Scheduler/STOP_NEW_USER_CONNECTION`: tags used to stop new users bound to the delivery group from establishing a connection.

This parameter is required.'),
}

model UntagCloudResourcesResponseBody = {
  failedResources?: [ 
    {
      code?: string(name='Code', description='The error code.', example='UNTAG_RESOURCE_FAILED'),
      message?: string(name='Message', description='The error message.', example='Failed to untag resource.'),
      resourceId?: string(name='ResourceId', description='The resource IDs.', example='aig-00000001'),
      resourceType?: string(name='ResourceType', description='The type of the cloud resource.

Valid values:

*   AppId: app ID.
*   WyId: Alibaba Cloud Workspace user ID.
*   AppInstanceGroupId: delivery group ID.
*   AliUid: tenant ID.', example='AppInstanceGroupId'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='Resolution'),
          scope?: string(name='Scope', description='The tag type.

Valid values:

*   Custom: custom tag.
*   System: system tag.', example='Custom'),
        }
      ](name='Tags', description='The tags that failed to be removed from the cloud resources.'),
    }
  ](name='FailedResources', description='The cloud resources whose tags failed to be removed and the corresponding tags.'),
  requestId?: string(name='RequestId', description='The request ID.', example='E25FC620-6B6F-12D2-A992-AD8727DC****'),
}

model UntagCloudResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagCloudResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from cloud resources.
 *
 * @param request UntagCloudResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagCloudResourcesResponse
 */
async function untagCloudResourcesWithOptions(request: UntagCloudResourcesRequest, runtime: Util.RuntimeOptions): UntagCloudResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceIds)) {
    body['ResourceIds'] = request.resourceIds;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKeys)) {
    body['TagKeys'] = request.tagKeys;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UntagCloudResources',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes tags from cloud resources.
 *
 * @param request UntagCloudResourcesRequest
 * @return UntagCloudResourcesResponse
 */
async function untagCloudResources(request: UntagCloudResourcesRequest): UntagCloudResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagCloudResourcesWithOptions(request, runtime);
}

model UpdateAppInstanceGroupImageRequest {
  appCenterImageId?: string(name='AppCenterImageId', description='The image ID of the application. You can obtain the ID from the Images page in the App Streaming console.

This parameter is required.', example='img-8z4nztpaqvay4****'),
  appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.

This parameter is required.', example='aig-9ciijz60n4xsv****'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region where the delivery group resides. For information about the supported regions, see [Limits](https://help.aliyun.com/document_detail/426036.html).

Valid values:

*   cn-shanghai: China (Shanghai).
*   cn-hangzhou: China (Hangzhou)

This parameter is required.', example='cn-hangzhou'),
  productType?: string(name='ProductType', description='The product type.

Valid value:

*   CloudApp: App Streaming

This parameter is required.', example='CloudApp'),
}

model UpdateAppInstanceGroupImageResponseBody = {
  code?: string(name='Code', description='The error code.', example='InvalidParameter.ProductType'),
  message?: string(name='Message', description='The error message.', example='The parameter ProductType is invalid.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model UpdateAppInstanceGroupImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAppInstanceGroupImageResponseBody(name='body'),
}

/**
 * @summary Updates the image of a delivery group.
 *
 * @description **
 * **Warning** After the image is updated, the end user session accessing the cloud application will be disconnected. Exercise caution to avoid end user data loss.
 * >  After the image of the delivery group is updated, the change takes effect on the terminal in approximately 2 minutes.
 *
 * @param request UpdateAppInstanceGroupImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAppInstanceGroupImageResponse
 */
async function updateAppInstanceGroupImageWithOptions(request: UpdateAppInstanceGroupImageRequest, runtime: Util.RuntimeOptions): UpdateAppInstanceGroupImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appCenterImageId)) {
    query['AppCenterImageId'] = request.appCenterImageId;
  }
  if (!Util.isUnset(request.appInstanceGroupId)) {
    query['AppInstanceGroupId'] = request.appInstanceGroupId;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppInstanceGroupImage',
    version = '2021-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the image of a delivery group.
 *
 * @description **
 * **Warning** After the image is updated, the end user session accessing the cloud application will be disconnected. Exercise caution to avoid end user data loss.
 * >  After the image of the delivery group is updated, the change takes effect on the terminal in approximately 2 minutes.
 *
 * @param request UpdateAppInstanceGroupImageRequest
 * @return UpdateAppInstanceGroupImageResponse
 */
async function updateAppInstanceGroupImage(request: UpdateAppInstanceGroupImageRequest): UpdateAppInstanceGroupImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppInstanceGroupImageWithOptions(request, runtime);
}

